PHP Class Ezrbac

Author: Roni Kumar Saha ([email protected])
ファイルを表示 Open project: xiidea/ezrbac

Public Methods

Method Description
__construct ( )
createUser ( array $data = [] ) : mixed api create new user
getCurrentUser ( ) : null | obj return the user object for logged in user
getCurrentUserID ( ) : null | integer return the user id for logged in user
getUserByID ( $user_id ) : mixed find and return user object by user ID
getUserMeta ( $user_id ) : mixed return the user meta data
isGuest ( ) : boolean check if accessing as guest user or not
logoutUrl ( ) : string find and return Logout url
registerUserSession ( $user, boolean $remember = FALSE ) : boolean Helpful if you have your login verification script, you can register session just by passing the user object
setCurrentUser ( $user ) : mixed set current user object while login
updateUser ( array $data = [] ) : mixed api update user data

Method Details

__construct() public method

public __construct ( )

createUser() public method

api create new user
public createUser ( array $data = [] ) : mixed
$data array
return mixed

getCurrentUser() public method

return the user object for logged in user
public getCurrentUser ( ) : null | obj
return null | obj

getCurrentUserID() public method

return the user id for logged in user
public getCurrentUserID ( ) : null | integer
return null | integer

getUserByID() public method

find and return user object by user ID
public getUserByID ( $user_id ) : mixed
$user_id
return mixed

getUserMeta() public method

return the user meta data
public getUserMeta ( $user_id ) : mixed
$user_id
return mixed

isGuest() public method

check if accessing as guest user or not
public isGuest ( ) : boolean
return boolean

logoutUrl() public method

find and return Logout url
public logoutUrl ( ) : string
return string

registerUserSession() public method

Helpful if you have your login verification script, you can register session just by passing the user object
public registerUserSession ( $user, boolean $remember = FALSE ) : boolean
$user
$remember boolean
return boolean

setCurrentUser() public method

set current user object while login
public setCurrentUser ( $user ) : mixed
$user
return mixed

updateUser() public method

api update user data
public updateUser ( array $data = [] ) : mixed
$data array
return mixed