PHP Класс RainLab\User\Models\User

Наследование: extends October\Rain\Auth\Models\User, use trait October\Rain\Database\Traits\SoftDeleting
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$attachOne
$belongsToMany Relations
$loginAttribute
$rules Validation rules

Защищенные свойства (Protected)

Свойство Тип Описание
$dates
$fillable The attributes that are mass assignable.
$purgeable Purge attributes from data set.
$table The database table used by the model.

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

Метод Описание
afterCreate ( ) : void After create event
afterDelete ( ) : void After delete event
afterLogin ( ) : void After login event
attemptActivation ( string $code ) : void Sends the confirmation email to a user, after activating.
ban ( ) : void Ban this user, preventing them from signing in.
beforeValidate ( ) : void Before validation event
convertToRegistered ( $sendNotification = true ) : void Converts a guest user to a registered one and sends an invitation notification.
findByEmail ( $email ) : self Looks up a user by their email address.
getAvatarThumb ( $size = 25, $options = null ) Returns the public image file path to this user's avatar.
getLastSeen ( ) : Carbon\Carbon Returns the date this user was last seen.
getLoginName ( ) : string Returns the name for the user's login.
getPersistCode ( ) : string Gets a code for when the user is persisted to a cookie or session which identifies the user.
isBanned ( ) : boolean Check if the user is banned.
isOnline ( ) : boolean Returns true if the user has been active within the last 5 minutes.
scopeFilterByGroup ( $query, $filter )
scopeIsActivated ( $query )
touchLastSeen ( ) : void Checks if the user has been seen in the last 5 minutes, and if not, updates the last_seen timestamp to reflect their online status.
unban ( ) : void Remove the ban on this user.

Защищенные методы

Метод Описание
generatePassword ( ) : void Assigns this user with a random password.
getNotificationVars ( ) : array Returns the variables available when sending a user notification.
sendInvitation ( ) : void Sends an invitation to the user using template "rainlab.user::mail.invite".

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

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

After create event
public afterCreate ( ) : void
Результат void

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

After delete event
public afterDelete ( ) : void
Результат void

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

After login event
public afterLogin ( ) : void
Результат void

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

Sends the confirmation email to a user, after activating.
public attemptActivation ( string $code ) : void
$code string
Результат void

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

Ban this user, preventing them from signing in.
public ban ( ) : void
Результат void

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

Before validation event
public beforeValidate ( ) : void
Результат void

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

Converts a guest user to a registered one and sends an invitation notification.
public convertToRegistered ( $sendNotification = true ) : void
Результат void

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

Looks up a user by their email address.
public static findByEmail ( $email ) : self
Результат self

generatePassword() защищенный Метод

Assigns this user with a random password.
protected generatePassword ( ) : void
Результат void

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

Returns the public image file path to this user's avatar.
public getAvatarThumb ( $size = 25, $options = null )

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

Returns the date this user was last seen.
public getLastSeen ( ) : Carbon\Carbon
Результат Carbon\Carbon

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

Returns the name for the user's login.
public getLoginName ( ) : string
Результат string

getNotificationVars() защищенный Метод

Returns the variables available when sending a user notification.
protected getNotificationVars ( ) : array
Результат array

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

Gets a code for when the user is persisted to a cookie or session which identifies the user.
public getPersistCode ( ) : string
Результат string

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

Check if the user is banned.
public isBanned ( ) : boolean
Результат boolean

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

Returns true if the user has been active within the last 5 minutes.
public isOnline ( ) : boolean
Результат boolean

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

public scopeFilterByGroup ( $query, $filter )

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

public scopeIsActivated ( $query )

sendInvitation() защищенный Метод

Sends an invitation to the user using template "rainlab.user::mail.invite".
protected sendInvitation ( ) : void
Результат void

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

Checks if the user has been seen in the last 5 minutes, and if not, updates the last_seen timestamp to reflect their online status.
public touchLastSeen ( ) : void
Результат void

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

Remove the ban on this user.
public unban ( ) : void
Результат void

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

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

public $attachOne

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

Relations
public $belongsToMany

$dates защищенное свойство

protected $dates

$fillable защищенное свойство

The attributes that are mass assignable.
protected $fillable

$loginAttribute публичное статическое свойство

public static $loginAttribute

$purgeable защищенное свойство

Purge attributes from data set.
protected $purgeable

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

Validation rules
public $rules

$table защищенное свойство

The database table used by the model.
protected $table