UserTrait
Trait UserTrait
Table of Contents
Methods
- authenticate() : bool
- Authenticate user.
- authorize() : bool|null
- Checks user authorization to the action.
- get() : mixed
- getAvatarImage() : ImageMedium|StaticImageMedium|null
- Return media object for the User's avatar.
- getAvatarUrl() : string
- Return the User's avatar URL
- save() : mixed
- set() : mixed
- undef() : mixed
- generateMultiavatar() : string
Methods
authenticate()
Authenticate user.
public
authenticate(string $password) : bool
If user password needs to be updated, new information will be saved.
Parameters
- $password : string
-
Plaintext password.
Return values
boolauthorize()
Checks user authorization to the action.
public
authorize(string $action[, string|null $scope = null ]) : bool|null
Parameters
- $action : string
- $scope : string|null = null
Return values
bool|nullget()
public
abstract get(mixed $name[, mixed $default = null ][, mixed $separator = null ]) : mixed
Parameters
- $name : mixed
- $default : mixed = null
- $separator : mixed = null
getAvatarImage()
Return media object for the User's avatar.
public
getAvatarImage() : ImageMedium|StaticImageMedium|null
Note: if there's no local avatar image for the user, you should call getAvatarUrl() to get the external avatar URL.
Return values
ImageMedium|StaticImageMedium|nullgetAvatarUrl()
Return the User's avatar URL
public
getAvatarUrl() : string
Return values
stringsave()
public
abstract save() : mixed
set()
public
abstract set(mixed $name, mixed $value[, mixed $separator = null ]) : mixed
Parameters
- $name : mixed
- $value : mixed
- $separator : mixed = null
undef()
public
abstract undef(mixed $name[, mixed $separator = null ]) : mixed
Parameters
- $name : mixed
- $separator : mixed = null
generateMultiavatar()
protected
generateMultiavatar(string $hash) : string
Parameters
- $hash : string