vB_Api_Profile
extends vB_Api
in package
vB_Api_Profile
Table of Contents
Methods
- __serialize() : array<string|int, mixed>
- __sleep() : array<string|int, mixed>
- __unserialize() : void
- __wakeup() : void
- callNamed() : The
- Call the given api function by name with a named arguments list.
- checkApiState() : mixed
- This method checks whether the API method is enabled.
- clearCache() : mixed
- Clears all previously loaded API objects.
- cropFileData() : mixed
- fetchMedia() : mixed
- Lists the media for a user
- getAlbum() : mixed
- Returns the album data for presentation on the media detail page for either a node, or one of the two pseudo-Albums
- getAlbumDisplayConditions() : array<string|int, mixed>
- Meant to be a template helper method only. Do not rely on it for security.
- getAllowedFonts() : array<string|int, mixed>
- return font information for profile customization
- getApiClassName() : mixed
- getDefaultAvatars() : mixed
- Get the default avatars- creates the profile UI tab
- getLanguages() : mixed
- Get languages for current user settings
- getSlideshow() : mixed
- getStyles() : mixed
- Get styles for current user settings
- instance() : vB_Api
- Returns an instance of the API object which translates exceptions to an array Use this method for API clients.
- instanceInternal() : vB_Api
- Returns an instance of the API object which doesn't handle exceptions This should only be used in other API objects, not for clients of the API
- map_vb4_input_to_vb5() : string
- Returns vb5 api method name.
- map_vb5_errors_to_vb4() : mixed
- Alters the error array in any way necessary to interface correctly with vb4.
- map_vb5_output_to_vb4() : mixed
- Alters the output array in any way necessary to interface correctly with vb4.
- resetAvatar() : mixed
- upload() : mixed
- Upload an avatar and set it as the user's profile image.
- uploadUrl() : mixed
- Upload an avatar from a URL and set it to be this user's custom avatar
Methods
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $serialized) : void
Parameters
- $serialized : array<string|int, mixed>
__wakeup()
public
__wakeup() : void
callNamed()
Call the given api function by name with a named arguments list.
public
callNamed() : The
Used primarily to translate REST requests into API calls.
Return values
The —return of the method or an error if the method doesn't exist, or is static, a constructor or destructor, or otherwise shouldn't be callable as and API method. It is also an error if the value of a paramater is not provided and that parameter doesn't have a default value.
checkApiState()
This method checks whether the API method is enabled.
public
checkApiState(mixed $method) : mixed
For extensions check make sure $controller property is already set.
Parameters
- $method : mixed
clearCache()
Clears all previously loaded API objects.
public
static clearCache() : mixed
Intended for use in tests where the loading pattern can cause issues with objects that cache thier own data.
cropFileData()
public
cropFileData(mixed $filedataid[, mixed $data = array() ]) : mixed
Parameters
- $filedataid : mixed
- $data : mixed = array()
fetchMedia()
Lists the media for a user
public
fetchMedia(mixed $mediaFilter[, mixed $page = 1 ][, mixed $perpage = 12 ][, mixed $params = array() ]) : mixed
Parameters
- $mediaFilter : mixed
- $page : mixed = 1
- $perpage : mixed = 12
- $params : mixed = array()
Return values
mixed —array of media data- format is getContent
getAlbum()
Returns the album data for presentation on the media detail page for either a node, or one of the two pseudo-Albums
public
getAlbum(mixed $filters) : mixed
Parameters
- $filters : mixed
Return values
mixed —array with key nodeid, node values and photo and/or attachment sub-arrays
getAlbumDisplayConditions()
Meant to be a template helper method only. Do not rely on it for security.
public
getAlbumDisplayConditions(array<string|int, mixed> $filters) : array<string|int, mixed>
Parameters
- $filters : array<string|int, mixed>
-
@see getAlbum()
Tags
Return values
array<string|int, mixed> —[bool 'showfull' => true if gallery allows fullsized images bool 'showthumb' => true if gallery allows thumbnail images bool 'showrestricted' => true if gallery has a mix of full and thumbnail images]
getAllowedFonts()
return font information for profile customization
public
getAllowedFonts() : array<string|int, mixed>
Return values
array<string|int, mixed> —with two elements- fontsizes and fontnames.
getApiClassName()
public
static getApiClassName(mixed $controller) : mixed
Parameters
- $controller : mixed
getDefaultAvatars()
Get the default avatars- creates the profile UI tab
public
getDefaultAvatars() : mixed
getLanguages()
Get languages for current user settings
public
getLanguages([mixed $userLanguageId = 0 ]) : mixed
Parameters
- $userLanguageId : mixed = 0
Return values
mixed —Array of languages.
getSlideshow()
public
getSlideshow(mixed $filters) : mixed
Parameters
- $filters : mixed
getStyles()
Get styles for current user settings
public
getStyles() : mixed
Return values
mixed —Array of styles
instance()
Returns an instance of the API object which translates exceptions to an array Use this method for API clients.
public
static instance(string $controller[, bool $refresh_cache = false ]) : vB_Api
Parameters
- $controller : string
-
-- name of the API controller to load
- $refresh_cache : bool = false
-
-- true if we want to force the cache to update with a new api object primarily intended for testing
Return values
vB_ApiinstanceInternal()
Returns an instance of the API object which doesn't handle exceptions This should only be used in other API objects, not for clients of the API
public
static instanceInternal(string $controller[, bool $refresh_cache = false ]) : vB_Api
Parameters
- $controller : string
-
-- name of the API controller to load
- $refresh_cache : bool = false
-
-- true if we want to force the cache to update with a new api object primarily intended for testing
Return values
vB_Apimap_vb4_input_to_vb5()
Returns vb5 api method name.
public
static map_vb4_input_to_vb5(string $method, array<string|int, mixed> &$request) : string
May alter request array.
Parameters
- $method : string
-
-- vb4 method name
- $request : array<string|int, mixed>
-
-- $_REQUEST array for this api request
Return values
stringmap_vb5_errors_to_vb4()
Alters the error array in any way necessary to interface correctly with vb4.
public
static map_vb5_errors_to_vb4(string $method, array<string|int, mixed> &$data) : mixed
Parameters
- $method : string
-
-- vb4 method name
- $data : array<string|int, mixed>
-
-- error array from vb5
map_vb5_output_to_vb4()
Alters the output array in any way necessary to interface correctly with vb4.
public
static map_vb5_output_to_vb4(string $method, array<string|int, mixed> &$data) : mixed
Parameters
- $method : string
-
-- vb4 method name
- $data : array<string|int, mixed>
-
-- output array from vb5
resetAvatar()
public
resetAvatar([mixed $type = 'avatar' ]) : mixed
Parameters
- $type : mixed = 'avatar'
upload()
Upload an avatar and set it as the user's profile image.
public
upload(mixed $file[, mixed $data = [] ]) : mixed
Parameters
- $file : mixed
- $data : mixed = []
Return values
mixed —an array- which can have $errors or avatarpath- the path from baseurl_core
uploadUrl()
Upload an avatar from a URL and set it to be this user's custom avatar
public
uploadUrl(mixed $url[, mixed $data = array() ]) : mixed
Parameters
- $url : mixed
- $data : mixed = array()
Return values
mixed —an array- which can have $errors or avatarpath- the path from baseurl_core