PHP Class Gc\User\Model

Inheritance: extends Gc\Db\AbstractTable
Show file Open project: gotcms/gotcms Class Usage Examples

Protected Properties

Property Type Description
$name string Table name

Public Methods

Method Description
authenticate ( string $login, string $password ) : boolean Authenticate user
delete ( ) : boolean Delete user
fromArray ( array $array ) : Model Initiliaze from array
fromId ( integer $userId ) : Model Initiliaze from id
getAcl ( boolean $forceReload = false ) : Model Get User Role
getName ( ) : string Return user name
getRole ( boolean $forceReload = false ) : Model Get User Role
save ( ) : integer Save user
sendForgotPasswordEmail ( string $email ) : boolean Send new password
setEmail ( string $userEmail ) : boolean Set User email
setPassword ( string $userPassword, boolean $encrypt = true ) : void Set user password

Method Details

authenticate() public method

Authenticate user
public authenticate ( string $login, string $password ) : boolean
$login string Login
$password string Password
return boolean

delete() public method

Delete user
public delete ( ) : boolean
return boolean

fromArray() public static method

Initiliaze from array
public static fromArray ( array $array ) : Model
$array array Data
return Model

fromId() public static method

Initiliaze from id
public static fromId ( integer $userId ) : Model
$userId integer User id
return Model

getAcl() public method

Get User Role
public getAcl ( boolean $forceReload = false ) : Model
$forceReload boolean Force reload
return Gc\User\Role\Model

getName() public method

Return user name
public getName ( ) : string
return string

getRole() public method

Get User Role
public getRole ( boolean $forceReload = false ) : Model
$forceReload boolean Force reload
return Gc\User\Role\Model

save() public method

Save user
public save ( ) : integer
return integer

sendForgotPasswordEmail() public method

Send new password
public sendForgotPasswordEmail ( string $email ) : boolean
$email string Email address
return boolean

setEmail() public method

Set User email
public setEmail ( string $userEmail ) : boolean
$userEmail string Email address
return boolean

setPassword() public method

Set user password
public setPassword ( string $userPassword, boolean $encrypt = true ) : void
$userPassword string User password
$encrypt boolean Encrypt or not the password
return void

Property Details

$name protected property

Table name
protected string $name
return string