PHP Interface Prado\Security\IUser

This interface must be implemented by user objects.
Since: 3.0
Author: Qiang Xue ([email protected])
Datei anzeigen Open project: pradosoft/prado

Public Methods

Method Description
getIsGuest ( ) : boolean
getName ( ) : string
getRoles ( ) : array
isInRole ( $role ) : boolean
loadFromString ( $string ) : Prado\Security\IUser
saveToString ( ) : string
setIsGuest ( $value )
setName ( $value )
setRoles ( $value ) : array | string

Method Details

getIsGuest() public method

public getIsGuest ( ) : boolean
return boolean if the user is a guest

getName() public method

public getName ( ) : string
return string username

getRoles() public method

public getRoles ( ) : array
return array list of roles that the user is of

isInRole() public method

public isInRole ( $role ) : boolean
return boolean whether the user is of this role

loadFromString() public method

public loadFromString ( $string ) : Prado\Security\IUser
return Prado\Security\IUser the user object

saveToString() public method

public saveToString ( ) : string
return string user data that is serialized and will be stored in session

setIsGuest() public method

public setIsGuest ( $value )

setName() public method

public setName ( $value )

setRoles() public method

public setRoles ( $value ) : array | string
return array | string list of roles that the user is of. If it is a string, roles are assumed by separated by comma