Streams.Avatar Class
Class representing 'Avatar' rows in the 'Streams' database
stored primarily on publisherId's shard
Constructor
Streams.Avatar
-
fields
Parameters:
-
fields
ObjectThe fields values to initialize table row as an associative array of
{column: value}
pairs
Item Index
Methods
- displayName
- fetch static
- setUp
- toArray
Methods
displayName
-
[options]
-
[fallback='Someone']
Get the display name from a Streams.Avatar
Parameters:
-
[options]
Object optionalA bunch of options which can include:
-
[short]
Boolean optionalShow one part of the name only
-
[show]
Boolean optionalThe parts of the name to show. Can have "f", "fu", "l", "lu", "flu" and "u" separated by spaces. The "fu" and "lu" represent firstname or lastname with fallback to username, while "flu" is "firstname lastname" with a fallback to username.
-
[html]
Boolean optionalIf true, encloses the first name, last name, username in span tags. If an array, then it will be used as the attributes of the html.
-
[escape]
Boolean optionalIf true, does HTML escaping of the retrieved fields
-
-
[fallback='Someone']
String optionalWhat to return if there is no info to get displayName from.
Returns:
fetch
-
toUserId
-
publisherId
-
callback
Fetches a Streams.Avatar object. The Streams plugin maintains an avatar for every user that authenticates the app.
setUp
()
The setUp() method is called the first time an object of this class is constructed.
toArray
()
Get plain object representing the row, as well as displayName and shortName