Class app\models\User
Inheritance | app\models\User » yii\base\BaseObject |
---|---|
Implements | yii\base\Configurable, yii\web\IdentityInterface |
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$accessToken | app\models\User | ||
$authKey | app\models\User | ||
$id | app\models\User | ||
$password | app\models\User | ||
$username | app\models\User |
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | yii\base\BaseObject |
__construct() | Constructor. | yii\base\BaseObject |
__get() | Returns the value of an object property. | yii\base\BaseObject |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\base\BaseObject |
__set() | Sets value of an object property. | yii\base\BaseObject |
__unset() | Sets an object property to null. | yii\base\BaseObject |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\BaseObject |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\BaseObject |
className() | Returns the fully qualified name of this class. | yii\base\BaseObject |
findByUsername() | Finds user by username | app\models\User |
findIdentity() | Finds an identity by the given ID. | app\models\User |
findIdentityByAccessToken() | Finds an identity by the given token. | app\models\User |
getAuthKey() | Returns a key that can be used to check the validity of a given identity ID. | app\models\User |
getId() | Returns an ID that can uniquely identify a user identity. | app\models\User |
hasMethod() | Returns a value indicating whether a method is defined. | yii\base\BaseObject |
hasProperty() | Returns a value indicating whether a property is defined. | yii\base\BaseObject |
init() | Initializes the object. | yii\base\BaseObject |
validateAuthKey() | Validates the given auth key. | app\models\User |
validatePassword() | Validates password | app\models\User |
Property Details
Method Details
Finds user by username
public static static|null findByUsername ( $username ) | ||
$username | string |
Finds an identity by the given ID.
public static yii\web\IdentityInterface findIdentity ( $id ) | ||
$id | string|integer | The ID to be looked for |
return | yii\web\IdentityInterface | The identity object that matches the given ID. Null should be returned if such an identity cannot be found or the identity is not in an active state (disabled, deleted, etc.) |
---|
Finds an identity by the given token.
public static yii\web\IdentityInterface findIdentityByAccessToken ( $token, $type = null ) | ||
$token | mixed | The token to be looked for |
$type | mixed | The type of the token. The value of this parameter depends on the implementation.
For example, yii\filters\auth\HttpBearerAuth will set this parameter to be |
return | yii\web\IdentityInterface | The identity object that matches the given token. Null should be returned if such an identity cannot be found or the identity is not in an active state (disabled, deleted, etc.) |
---|
Returns a key that can be used to check the validity of a given identity ID.
The key should be unique for each individual user, and should be persistent so that it can be used to check the validity of the user identity.
The space of such keys should be big enough to defeat potential identity attacks.
This is required if \User::enableAutoLogin is enabled.
public string getAuthKey ( ) | ||
return | string | A key that is used to check the validity of a given identity ID. |
---|
Returns an ID that can uniquely identify a user identity.
public string|integer getId ( ) | ||
return | string|integer | An ID that uniquely identifies a user identity. |
---|
Validates the given auth key.
This is required if \User::enableAutoLogin is enabled.
public boolean validateAuthKey ( $authKey ) | ||
$authKey | string | The given auth key |
return | boolean | Whether the given auth key is valid. |
---|
Validates password
public boolean validatePassword ( $password ) | ||
$password | string | Password to validate |
return | boolean | If password provided is valid for current user |
---|