PHP Class amnah\yii2\user\models\User

Inheritance: extends yii\db\ActiveRecord, implements yii\web\IdentityInterface
Show file Open project: amnah/yii2-user Class Usage Examples

Public Properties

Property Type Description
$currentPassword Current password - for account page updates
$module amnah\yii2\user\Module
$newPassword New password - for registration and changing password
$newPasswordConfirm New password confirmation - for reset

Protected Properties

Property Type Description
$permissionCache Permission cache array

Public Methods

Method Description
attributeLabels ( )
beforeSave ( $insert )
behaviors ( )
can ( string $permissionName, array $params = [], boolean $allowCaching = true ) : boolean Check if user can do specified $permission
checkEmailChange ( ) : string | boolean Check for email change
confirm ( string $newEmail ) : boolean Confirm user email
findIdentity ( $id )
findIdentityByAccessToken ( $token, $type = null )
getAuthKey ( )
getDisplayName ( ) : string | integer Get display name for the user
getId ( )
getProfile ( ) : ActiveQuery
getRole ( ) : ActiveQuery
getUserAuths ( ) : ActiveQuery
getUserTokens ( ) : ActiveQuery
init ( )
rules ( )
sendEmailConfirmation ( amnah\yii2\user\models\UserToken $userToken ) : integer Send email confirmation to user
setRegisterAttributes ( integer $roleId, string $status = null ) : static Set attributes for registration
statusDropdown ( ) : array Get list of statuses for creating dropdowns
updateLoginMeta ( ) : boolean Update login info (ip and time)
validateAuthKey ( $authKey )
validateCurrentPassword ( ) Validate current password (account page)
validatePassword ( string $password ) : boolean Validate password

Method Details

attributeLabels() public method

public attributeLabels ( )

beforeSave() public method

public beforeSave ( $insert )

behaviors() public method

public behaviors ( )

can() public method

Check if user can do specified $permission
public can ( string $permissionName, array $params = [], boolean $allowCaching = true ) : boolean
$permissionName string
$params array
$allowCaching boolean
return boolean

checkEmailChange() public method

Check for email change
public checkEmailChange ( ) : string | boolean
return string | boolean

confirm() public method

Confirm user email
public confirm ( string $newEmail ) : boolean
$newEmail string
return boolean

findIdentity() public static method

public static findIdentity ( $id )

findIdentityByAccessToken() public static method

public static findIdentityByAccessToken ( $token, $type = null )

getAuthKey() public method

public getAuthKey ( )

getDisplayName() public method

Get display name for the user
public getDisplayName ( ) : string | integer
return string | integer

getId() public method

public getId ( )

getProfile() public method

public getProfile ( ) : ActiveQuery
return yii\db\ActiveQuery

getRole() public method

public getRole ( ) : ActiveQuery
return yii\db\ActiveQuery

getUserAuths() public method

public getUserAuths ( ) : ActiveQuery
return yii\db\ActiveQuery

getUserTokens() public method

public getUserTokens ( ) : ActiveQuery
return yii\db\ActiveQuery

init() public method

public init ( )

rules() public method

public rules ( )

sendEmailConfirmation() public method

Send email confirmation to user
public sendEmailConfirmation ( amnah\yii2\user\models\UserToken $userToken ) : integer
$userToken amnah\yii2\user\models\UserToken
return integer

setRegisterAttributes() public method

Set attributes for registration
public setRegisterAttributes ( integer $roleId, string $status = null ) : static
$roleId integer
$status string
return static

statusDropdown() public static method

Get list of statuses for creating dropdowns
public static statusDropdown ( ) : array
return array

updateLoginMeta() public method

Update login info (ip and time)
public updateLoginMeta ( ) : boolean
return boolean

validateAuthKey() public method

public validateAuthKey ( $authKey )

validateCurrentPassword() public method

Validate current password (account page)

validatePassword() public method

Validate password
public validatePassword ( string $password ) : boolean
$password string
return boolean

Property Details

$currentPassword public property

Current password - for account page updates
public $currentPassword

$module public property

public Module,amnah\yii2\user $module
return amnah\yii2\user\Module

$newPassword public property

New password - for registration and changing password
public $newPassword

$newPasswordConfirm public property

New password confirmation - for reset
public $newPasswordConfirm

$permissionCache protected property

Permission cache array
protected $permissionCache