Class yeesoft\models\User

Inheritanceyeesoft\models\User » yeesoft\models\UserIdentity » yeesoft\db\ActiveRecord » yii\db\ActiveRecord
Implementsyii\web\IdentityInterface
Subclassesyeesoft\user\models\search\UserSearch

This is the model class for table "user".

Public Methods

Hide inherited methods

MethodDescriptionDefined By
assignRole() Assign role to user yeesoft\models\User
assignRoles() Assign roles to user yeesoft\models\User
attributeLabels() yeesoft\models\User
beforeDelete() Don't let delete yourself and don't let non-superadmin delete superadmin yeesoft\models\User
beforeSave() Make sure user will not deactivate himself and superadmin could not demote himself Also don't let non-superadmin edit superadmin yeesoft\models\User
behaviors() yeesoft\models\User
canRoute() Useful for Menu widget yeesoft\models\User
find() yeesoft\models\User
findByConfirmationToken() Finds user by confirmation token yeesoft\models\UserIdentity
findByUsername() Finds user by username yeesoft\models\UserIdentity
findIdentity() yeesoft\models\UserIdentity
findIdentityByAccessToken() yeesoft\models\UserIdentity
findInactiveByConfirmationToken() Finds user by confirmation token yeesoft\models\UserIdentity
generateAuthKey() Generates "remember me" authentication key yeesoft\models\UserIdentity
generateConfirmationToken() Generates new confirmation token yeesoft\models\UserIdentity
generatePasswordResetToken() Generates new password reset token yeesoft\models\User
getAuthKey() yeesoft\models\UserIdentity
getAvatar() yeesoft\models\User
getCreatedDate() Get created date yeesoft\models\User
getCreatedDatetime() Get created datetime yeesoft\models\User
getCreatedTime() Get created time yeesoft\models\User
getCurrentUser() Store result in session to prevent multiple db requests with multiple calls yeesoft\models\User
getId() yeesoft\models\UserIdentity
getRoles() yeesoft\models\User
getStatusList() GetStatusList yeesoft\models\User
getStatusValue() GetStatusValue yeesoft\models\User
getUpdatedDate() Get created date yeesoft\models\User
getUpdatedDatetime() Get created datetime yeesoft\models\User
getUpdatedTime() Get created time yeesoft\models\User
getUsersList() GetUsersList yeesoft\models\User
hasPermission() yeesoft\models\User
hasRole() yeesoft\models\User
isMultilingual() Returns TRUE if model support multilingual behavior. yeesoft\db\ActiveRecord
removeAvatar() yeesoft\models\User
removeConfirmationToken() Removes confirmation token yeesoft\models\UserIdentity
revokeRole() Revoke role from user yeesoft\models\User
rules() yeesoft\models\User
setAvatars() yeesoft\models\User
setPassword() Generates password hash from password and sets it to the model yeesoft\models\UserIdentity
tableName() yeesoft\models\User
validateAuthKey() yeesoft\models\UserIdentity
validateBindToIp() Validate bind_to_ip attr to be in correct format yeesoft\models\User
validateEmailUnique() Check that there is no such confirmed E-mail in the system yeesoft\models\User
validatePassword() Validates password yeesoft\models\UserIdentity

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
SCENARIO_NEW_USER 'newUser' yeesoft\models\User
STATUS_ACTIVE 10 yeesoft\models\User
STATUS_BANNED -1 yeesoft\models\User
STATUS_INACTIVE 0 yeesoft\models\User

Property Details

$gridRoleSearch public property
public string $gridRoleSearch null
$password public property
public string $password null
$repeat_password public property
public string $repeat_password null

Method Details

assignRole() public static method

Assign role to user

public static bool assignRole ( $userId, $roleName )
$userId int
$roleName string
assignRoles() public method

Assign roles to user

public bool assignRoles ( array $roles )
$roles array
attributeLabels() public method

public array attributeLabels ( )
beforeDelete() public method

Don't let delete yourself and don't let non-superadmin delete superadmin

public void beforeDelete ( )
beforeSave() public method

Make sure user will not deactivate himself and superadmin could not demote himself Also don't let non-superadmin edit superadmin

public void beforeSave ( $insert )
$insert
behaviors() public method

public void behaviors ( )
canRoute() public static method

Useful for Menu widget

... [ 'label'=>'Some label', 'url'=>['/site/index'], 'visible'=>User::canRoute(['/site/index']) ] ...
public static bool canRoute ( $route, $superAdminAllowed true )
$route string|array
$superAdminAllowed bool
find() public static method

public static \yeesoft\models\PostQuery find ( )
return \yeesoft\models\PostQuery

The active query used by this AR class.

generatePasswordResetToken() public method

Generates new password reset token

public void generatePasswordResetToken ( )
getAvatar() public method

public boolean|string getAvatar ( $size 'small' )
$size string
getCreatedDate() public method

Get created date

public string getCreatedDate ( )
getCreatedDatetime() public method

Get created datetime

public string getCreatedDatetime ( )
getCreatedTime() public method

Get created time

public string getCreatedTime ( )
getCurrentUser() public static method

Store result in session to prevent multiple db requests with multiple calls

public static static getCurrentUser ( $fromSession true )
$fromSession bool
getRoles() public method

public \yii\db\ActiveQuery getRoles ( )
getStatusList() public static method

GetStatusList

public static array getStatusList ( )
getStatusValue() public static method

GetStatusValue

public static string getStatusValue ( $val )
$val string
getUpdatedDate() public method

Get created date

public string getUpdatedDate ( )
getUpdatedDatetime() public method

Get created datetime

public string getUpdatedDatetime ( )
getUpdatedTime() public method

Get created time

public string getUpdatedTime ( )
getUsersList() public static method

GetUsersList

public static array getUsersList ( )
hasPermission() public static method

public static bool hasPermission ( $permission, $superAdminAllowed true )
$permission string
$superAdminAllowed bool
hasRole() public static method

public static bool hasRole ( $roles, $superAdminAllowed true )
$roles string|array
$superAdminAllowed bool
removeAvatar() public method

public void removeAvatar ( )
revokeRole() public static method

Revoke role from user

public static bool revokeRole ( $userId, $roleName )
$userId int
$roleName string
rules() public method

public void rules ( )
setAvatars() public method

public void setAvatars ( $avatars )
$avatars array
tableName() public static method

public static void tableName ( )
validateBindToIp() public method

Validate bind_to_ip attr to be in correct format

public void validateBindToIp ( )
validateEmailUnique() public method

Check that there is no such confirmed E-mail in the system

public void validateEmailUnique ( )