PHP Class common\models\User

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

Public Methods

Method Description
behaviors ( )
findByPasswordResetToken ( string $token ) : static | null Finds user by password reset token
findByUsername ( string $username ) : static | null Finds user by username
findIdentity ( $id )
findIdentityByAccessToken ( $token, $type = null )
generateAuthKey ( ) Generates "remember me" authentication key
generatePasswordResetToken ( ) Generates new password reset token
getAuthKey ( )
getId ( )
isPasswordResetTokenValid ( string $token ) : boolean Finds out if password reset token is valid
removePasswordResetToken ( ) Removes password reset token
rules ( )
setPassword ( string $password ) Generates password hash from password and sets it to the model
tableName ( )
validateAuthKey ( $authKey )
validatePassword ( string $password ) : boolean Validates password

Method Details

behaviors() public method

public behaviors ( )

findByPasswordResetToken() public static method

Finds user by password reset token
public static findByPasswordResetToken ( string $token ) : static | null
$token string password reset token
return static | null

findByUsername() public static method

Finds user by username
public static findByUsername ( string $username ) : static | null
$username string
return static | null

findIdentity() public static method

public static findIdentity ( $id )

findIdentityByAccessToken() public static method

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

generateAuthKey() public method

Generates "remember me" authentication key
public generateAuthKey ( )

generatePasswordResetToken() public method

Generates new password reset token

getAuthKey() public method

public getAuthKey ( )

getId() public method

public getId ( )

isPasswordResetTokenValid() public static method

Finds out if password reset token is valid
public static isPasswordResetTokenValid ( string $token ) : boolean
$token string password reset token
return boolean

removePasswordResetToken() public method

Removes password reset token

rules() public method

public rules ( )

setPassword() public method

Generates password hash from password and sets it to the model
public setPassword ( string $password )
$password string

tableName() public static method

public static tableName ( )

validateAuthKey() public method

public validateAuthKey ( $authKey )

validatePassword() public method

Validates password
public validatePassword ( string $password ) : boolean
$password string password to validate
return boolean if password provided is valid for current user