PHP Class YumUser

The followings are the available columns in table 'user':
Inheritance: extends YumActiveRecord
Afficher le fichier Open project: thyseus/yii-user-management Class Usage Examples

Méthodes publiques

Свойство Type Description
$activationKey
$filter_role
$password
$password_changed
$username

Méthodes publiques

Méthode Description
activate ( $email, $key ) Activation of an user account.
afterSave ( )
assignRole ( $role_title )
attributeLabels ( )
beforeValidate ( )
behaviors ( ) flag for password change
can ( $action, $subaction = null ) fulfilled (for example action 'forum', subaction 'read')
delete ( )
generateActivationKey ( $activate = false ) : string
getActivationUrl ( )
getActiveMemberships ( ) Which memberships are bought by the user
getAdmins ( ) : array Return admins.
getAvatar ( $thumb = false )
getFriends ( $everything = false ) set $everything to true to also return pending and rejected friendships
getFriendships ( )
getGravatarHash ( )
getLogins ( )
getPermissions ( $subaction = null ) 3.) All active memberships
getRoles ( )
getUsersByRole ( string $roleTitle ) : array Get all users with a specified role.
hasRole ( $role_title )
isActive ( )
isFriendOf ( $invited_id )
isOnline ( )
isPasswordExpired ( )
itemAlias ( $type, $code = NULL )
logout ( )
model ( $className = __CLASS__ )
register ( $username = null, $password = null, $profile = null ) Registers a user
registerByHybridAuth ( $hybridAuthProfile )
relations ( )
rules ( )
scopes ( )
search ( )
setLastAction ( ) last action when a user does something
setPassword ( $password ) only set the fields. Returns $this so this method can be chained.
syncRoles ( $roles = null )
tableName ( ) : string Returns resolved table name (incl. table prefix when it is set in db configuration) Following algorith of searching valid table name is implemented: - try to find out table name stored in currently used module - if not found try to get table name from UserModule configuration - if not found user default {{users}} table name
withRoles ( $roles )

Method Details

activate() public static méthode

If everything is set properly, and the emails exists in the database, and is associated with a correct user, and this user has the status NOTACTIVE and the given activationKey is identical to the one in the database then generate a new Activation key to avoid double activation, set the status to ACTIVATED and save the data Error Codes: -1 : User is not inactive, it can not be activated -2 : Wrong activation key -3 : Profile found, but no user - database inconsistency?
public static activate ( $email, $key )

afterSave() public méthode

public afterSave ( )

assignRole() public méthode

public assignRole ( $role_title )

attributeLabels() public méthode

public attributeLabels ( )

beforeValidate() public méthode

public beforeValidate ( )

behaviors() public méthode

flag for password change
public behaviors ( )

can() public méthode

fulfilled (for example action 'forum', subaction 'read')
public can ( $action, $subaction = null )

delete() public méthode

public delete ( )

generateActivationKey() public méthode

public generateActivationKey ( $activate = false ) : string
Résultat string

getActivationUrl() public méthode

public getActivationUrl ( )

getActiveMemberships() public méthode

Which memberships are bought by the user

getAdmins() public static méthode

Return admins.
public static getAdmins ( ) : array
Résultat array syperusers names

getAvatar() public méthode

public getAvatar ( $thumb = false )

getFriends() public méthode

set $everything to true to also return pending and rejected friendships
public getFriends ( $everything = false )

getFriendships() public méthode

public getFriendships ( )

getGravatarHash() public méthode

public getGravatarHash ( )

getLogins() public méthode

public getLogins ( )

getPermissions() public méthode

3.) All active memberships
public getPermissions ( $subaction = null )

getRoles() public méthode

public getRoles ( )

getUsersByRole() public static méthode

Get all users with a specified role.
public static getUsersByRole ( string $roleTitle ) : array
$roleTitle string title of role to be searched
Résultat array users with specified role. Null if none are found.

hasRole() public méthode

public hasRole ( $role_title )

isActive() public méthode

public isActive ( )

isFriendOf() public méthode

public isFriendOf ( $invited_id )

isOnline() public méthode

public isOnline ( )

isPasswordExpired() public méthode

public isPasswordExpired ( )

itemAlias() public static méthode

public static itemAlias ( $type, $code = NULL )

logout() public méthode

public logout ( )

model() public static méthode

public static model ( $className = __CLASS__ )

register() public méthode

Registers a user
public register ( $username = null, $password = null, $profile = null )

registerByHybridAuth() public méthode

public registerByHybridAuth ( $hybridAuthProfile )

relations() public méthode

public relations ( )

rules() public méthode

public rules ( )

scopes() public méthode

public scopes ( )

setLastAction() public méthode

last action when a user does something
public setLastAction ( )

setPassword() public méthode

only set the fields. Returns $this so this method can be chained.
public setPassword ( $password )

syncRoles() public méthode

public syncRoles ( $roles = null )

tableName() public méthode

Returns resolved table name (incl. table prefix when it is set in db configuration) Following algorith of searching valid table name is implemented: - try to find out table name stored in currently used module - if not found try to get table name from UserModule configuration - if not found user default {{users}} table name
public tableName ( ) : string
Résultat string

withRoles() public méthode

public withRoles ( $roles )

Property Details

$activationKey public_oe property

public $activationKey

$filter_role public_oe property

public $filter_role

$password public_oe property

public $password

$password_changed public_oe property

public $password_changed

$username public_oe property

public $username