PHP Class Redaxscript\Auth

Since: 3.0.0
Author: Henry Ruhs
显示文件 Open project: redaxmedia/redaxscript Class Usage Examples

Protected Properties

Property Type Description
$_callArray array array of the call
$_permissionArray array array of the permission
$_request object instance of the request class
$_typeArray array array of the type
$_userArray array array of the user

Public Methods

Method Description
__call ( string $method = null, array $argumentArray = [] ) : mixed call method as needed
__construct ( Request $request ) constructor of the class
getPermission ( string $key = null ) : mixed get the permission
getStatus ( ) : boolean get the auth status
getUser ( string $key = null ) : mixed get the user
init ( ) init the class
login ( integer $userId = null ) : boolean login the user
logout ( ) : boolean logout the user
save ( ) : boolean save user and permission
setPermission ( string $key = null, integer $value = null ) set the permission
setUser ( string $key = null, string $value = null ) set the user

Method Details

__call() public method

call method as needed
Since: 3.0.0
public __call ( string $method = null, array $argumentArray = [] ) : mixed
$method string name of the method
$argumentArray array arguments of the method
return mixed

__construct() public method

constructor of the class
Since: 3.0.0
public __construct ( Request $request )
$request Request instance of the request class

getPermission() public method

get the permission
Since: 3.0.0
public getPermission ( string $key = null ) : mixed
$key string key of the permission
return mixed

getStatus() public method

get the auth status
Since: 3.0.0
public getStatus ( ) : boolean
return boolean

getUser() public method

get the user
Since: 3.0.0
public getUser ( string $key = null ) : mixed
$key string key of the user
return mixed

init() public method

init the class
Since: 3.0.0
public init ( )

login() public method

login the user
Since: 3.0.0
public login ( integer $userId = null ) : boolean
$userId integer identifier of the user
return boolean

logout() public method

logout the user
Since: 3.0.0
public logout ( ) : boolean
return boolean

save() public method

save user and permission
Since: 3.0.0
public save ( ) : boolean
return boolean

setPermission() public method

set the permission
Since: 3.0.0
public setPermission ( string $key = null, integer $value = null )
$key string key of the permission
$value integer value of the permission

setUser() public method

set the user
Since: 3.0.0
public setUser ( string $key = null, string $value = null )
$key string key of the user
$value string value of the user

Property Details

$_callArray protected_oe property

array of the call
protected array $_callArray
return array

$_permissionArray protected_oe property

array of the permission
protected array $_permissionArray
return array

$_request protected_oe property

instance of the request class
protected object $_request
return object

$_typeArray protected_oe property

array of the type
protected array $_typeArray
return array

$_userArray protected_oe property

array of the user
protected array $_userArray
return array