Class app\modules\main\models\User
| Inheritance | app\modules\main\models\User » common\db\ActiveRecord » yii\db\ActiveRecord |
|---|---|
| Implements | app\modules\import\models\ICsvImportable, yii\web\IdentityInterface |
| Uses Traits | app\modules\main\components\PermissionTrait, common\db\CreatedAtSearchTrait |
Модель пользователей
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $confirm_password | string | подтверждение пароля | app\modules\main\models\User |
| $password | string | пароль | app\modules\main\models\User |
| $verifyCode | string | значение капчи | app\modules\main\models\User |
Protected Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $_baseScenarios | array | common\db\ActiveRecord | |
| $_createdAtFrom | common\db\CreatedAtSearchTrait | ||
| $_createdAtTo | common\db\CreatedAtSearchTrait | ||
| $_defaultSearchOrder | array | значение сортировки по умолчанию | common\db\ActiveRecord |
| $_metaFields | common\db\MetaFields | объект с описанием полей модели | common\db\ActiveRecord |
| $initScenarios | array | массив сценариев при которых инициалихируются начальные значения | app\modules\main\models\User |
Public Methods
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| DEFAULT_SORT | 500 | Значение сортировки по умолчанию | common\db\ActiveRecord |
| ROLE_ADMIN | "admin" | app\modules\main\models\User | |
| ROLE_ROOT | "root" | app\modules\main\models\User | |
| ROLE_USER | "user" | app\modules\main\models\User | |
| SCENARIO_INSERT | "insert" | Сценарии валидации | common\db\ActiveRecord |
| SCENARIO_REGISTER | "register" | app\modules\main\models\User | |
| SCENARIO_SEARCH | "search" | common\db\ActiveRecord | |
| SCENARIO_UPDATE | "update" | common\db\ActiveRecord | |
| VERIFY_CODE | "d58e3582afa99040e27b92b13c8f2280" | app\modules\main\models\User |
Property Details
подтверждение пароля
массив сценариев при которых инициалихируются начальные значения
пароль
значение капчи
Method Details
| void afterSave( $insert, $changeAttributes ) | ||
| $insert | ||
| $changeAttributes | ||
| void beforeSave( $insert ) | ||
| $insert | ||
| void fields( ) |
Finds user by password reset token
| static|null findByPasswordResetToken( $token ) | ||
| $token | string | Password reset token |
Finds user by username
| static|null findByUsername( $username ) | ||
| $username | string | |
| void findIdentity( $id ) | ||
| $id | ||
| void findIdentityByAccessToken( $token, $type = null ) | ||
| $token | ||
| $type | ||
Generates "remember me" authentication key
| void generateAuthKey( ) |
Generates new password reset token
| void generatePasswordResetToken( ) |
| void getAuthKey( ) |
Возвращает массив атрибутов доступных для импорта из csv
| array getCsvAttributes( ) |
Возвращает имя сущности
| string getEntityName( ) |
| void getId( ) |
Возвращает массив ролей, которые может создавать пользователь
| array getPermittedRoles( ) |
Возвращает все роли - потомки переданной роли
| array getRoleDescendant( \yii\rbac\Role $role ) | ||
| $role | \yii\rbac\Role | роль |
Возвращает массив ролей пользователей
| array getRolesNames( ) |
Возвращает имя класса содержащего описание полей модели
| string metaClass( ) |
Removes password reset token
| void removePasswordResetToken( ) |
Правила валидации Формируем из полей
| array rules( ) |
Generates password hash from password and sets it to the model
| void setPassword( $password ) | ||
| $password | string | |
Возвращает имя таблицы
| string tableName( ) |
| void validateAuthKey( $authKey ) | ||
| $authKey | ||
Validates password
| boolean validatePassword( $password ) | ||
| $password | string | Password to validate |
| return | boolean | If password provided is valid for current user |
|---|---|---|