PHP Класс YumUser

The followings are the available columns in table 'user':
Наследование: extends YumActiveRecord
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$activationKey
$filter_role
$password
$password_changed
$username

Открытые методы

Метод Описание
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 )

Описание методов

activate() публичный статический Метод

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 afterSave ( )

assignRole() публичный Метод

public assignRole ( $role_title )

attributeLabels() публичный Метод

public attributeLabels ( )

beforeValidate() публичный Метод

public beforeValidate ( )

behaviors() публичный Метод

flag for password change
public behaviors ( )

can() публичный Метод

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

delete() публичный Метод

public delete ( )

generateActivationKey() публичный Метод

public generateActivationKey ( $activate = false ) : string
Результат string

getActivationUrl() публичный Метод

public getActivationUrl ( )

getActiveMemberships() публичный Метод

Which memberships are bought by the user

getAdmins() публичный статический Метод

Return admins.
public static getAdmins ( ) : array
Результат array syperusers names

getAvatar() публичный Метод

public getAvatar ( $thumb = false )

getFriends() публичный Метод

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

getFriendships() публичный Метод

public getFriendships ( )

getGravatarHash() публичный Метод

public getGravatarHash ( )

getLogins() публичный Метод

public getLogins ( )

getPermissions() публичный Метод

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

getRoles() публичный Метод

public getRoles ( )

getUsersByRole() публичный статический Метод

Get all users with a specified role.
public static getUsersByRole ( string $roleTitle ) : array
$roleTitle string title of role to be searched
Результат array users with specified role. Null if none are found.

hasRole() публичный Метод

public hasRole ( $role_title )

isActive() публичный Метод

public isActive ( )

isFriendOf() публичный Метод

public isFriendOf ( $invited_id )

isOnline() публичный Метод

public isOnline ( )

isPasswordExpired() публичный Метод

public isPasswordExpired ( )

itemAlias() публичный статический Метод

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

logout() публичный Метод

public logout ( )

model() публичный статический Метод

public static model ( $className = __CLASS__ )

register() публичный Метод

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

registerByHybridAuth() публичный Метод

public registerByHybridAuth ( $hybridAuthProfile )

relations() публичный Метод

public relations ( )

rules() публичный Метод

public rules ( )

scopes() публичный Метод

public scopes ( )

setLastAction() публичный Метод

last action when a user does something
public setLastAction ( )

setPassword() публичный Метод

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

syncRoles() публичный Метод

public syncRoles ( $roles = null )

tableName() публичный Метод

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
Результат string

withRoles() публичный Метод

public withRoles ( $roles )

Описание свойств

$activationKey публичное свойство

public $activationKey

$filter_role публичное свойство

public $filter_role

$password публичное свойство

public $password

$password_changed публичное свойство

public $password_changed

$username публичное свойство

public $username