PHP Class RainLab\User\Models\User

Inheritance: extends October\Rain\Auth\Models\User, use trait October\Rain\Database\Traits\SoftDeleting
Afficher le fichier Open project: rainlab/user-plugin Class Usage Examples

Méthodes publiques

Свойство Type Description
$attachOne
$belongsToMany Relations
$loginAttribute
$rules Validation rules

Protected Properties

Свойство Type Description
$dates
$fillable The attributes that are mass assignable.
$purgeable Purge attributes from data set.
$table The database table used by the model.

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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".

Method Details

afterCreate() public méthode

After create event
public afterCreate ( ) : void
Résultat void

afterDelete() public méthode

After delete event
public afterDelete ( ) : void
Résultat void

afterLogin() public méthode

After login event
public afterLogin ( ) : void
Résultat void

attemptActivation() public méthode

Sends the confirmation email to a user, after activating.
public attemptActivation ( string $code ) : void
$code string
Résultat void

ban() public méthode

Ban this user, preventing them from signing in.
public ban ( ) : void
Résultat void

beforeValidate() public méthode

Before validation event
public beforeValidate ( ) : void
Résultat void

convertToRegistered() public méthode

Converts a guest user to a registered one and sends an invitation notification.
public convertToRegistered ( $sendNotification = true ) : void
Résultat void

findByEmail() public static méthode

Looks up a user by their email address.
public static findByEmail ( $email ) : self
Résultat self

generatePassword() protected méthode

Assigns this user with a random password.
protected generatePassword ( ) : void
Résultat void

getAvatarThumb() public méthode

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

getLastSeen() public méthode

Returns the date this user was last seen.
public getLastSeen ( ) : Carbon\Carbon
Résultat Carbon\Carbon

getLoginName() public méthode

Returns the name for the user's login.
public getLoginName ( ) : string
Résultat string

getNotificationVars() protected méthode

Returns the variables available when sending a user notification.
protected getNotificationVars ( ) : array
Résultat array

getPersistCode() public méthode

Gets a code for when the user is persisted to a cookie or session which identifies the user.
public getPersistCode ( ) : string
Résultat string

isBanned() public méthode

Check if the user is banned.
public isBanned ( ) : boolean
Résultat boolean

isOnline() public méthode

Returns true if the user has been active within the last 5 minutes.
public isOnline ( ) : boolean
Résultat boolean

scopeFilterByGroup() public méthode

public scopeFilterByGroup ( $query, $filter )

scopeIsActivated() public méthode

public scopeIsActivated ( $query )

sendInvitation() protected méthode

Sends an invitation to the user using template "rainlab.user::mail.invite".
protected sendInvitation ( ) : void
Résultat void

touchLastSeen() public méthode

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
Résultat void

unban() public méthode

Remove the ban on this user.
public unban ( ) : void
Résultat void

Property Details

$attachOne public_oe property

public $attachOne

$belongsToMany public_oe property

Relations
public $belongsToMany

$dates protected_oe property

protected $dates

$fillable protected_oe property

The attributes that are mass assignable.
protected $fillable

$loginAttribute public_oe static_oe property

public static $loginAttribute

$purgeable protected_oe property

Purge attributes from data set.
protected $purgeable

$rules public_oe property

Validation rules
public $rules

$table protected_oe property

The database table used by the model.
protected $table