PHP 클래스 Flarum\Core\User

상속: extends Flarum\Database\AbstractModel, use trait Flarum\Core\Support\EventGeneratorTrait, use trait Flarum\Core\Support\ScopeVisibilityTrait
파일 보기 프로젝트 열기: flarum/core 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$dates
$gate Flarum\Core\Access\Gate The access gate.
$hasher Illuminate\Contracts\Hashing\Hasher The hasher with which to hash passwords.
$permissions string[] | null An array of permissions that this user has.
$preferences array - transformer: a callback that confines the value of the preference - default: a default value if the preference isn't set
$session Symfony\Component\HttpFoundation\Session\SessionInterface
$table

공개 메소드들

메소드 설명
accessTokens ( ) : Illuminate\Database\Eloquent\Relations\HasMany Define the relationship with the user's access tokens.
activate ( ) Activate the user's account.
addPreference ( string $key, callable $transformer = null, mixed $default = null ) Register a preference with a transformer and a default value.
boot ( ) : void Boot the model.
can ( string $ability, array | mixed $arguments = [] ) : boolean
cannot ( string $ability, array | mixed $arguments = [] ) : boolean
changeAvatarPath ( string $path ) Change the path of the user avatar.
changeBio ( string $bio ) Change the user's bio.
changeEmail ( string $email ) Change the user's email.
changePassword ( string $password ) Change the user's password.
checkPassword ( string $password ) : boolean Check if a given password matches the user's password.
getAlertableNotificationTypes ( ) : array Get the notification types that should be alerted to this user, according to their preferences.
getAvatarUrlAttribute ( ) : string Get the URL of the user's avatar.
getGate ( ) : Flarum\Core\Access\Gate
getLocaleAttribute ( string $value ) : string Get the user's locale, falling back to the forum's default if they haven't set one.
getNewNotificationsCount ( ) : integer Get the number of new, unseen notifications for the user.
getNotificationPreferenceKey ( string $type, string $method ) : string Get the key for a preference which flags whether or not the user will receive a notification for $type via $method.
getPermissions ( ) : string[] Get a list of permissions that the user has.
getPreference ( string $key, mixed $default = null ) : mixed Get the value of a preference for this user.
getPreferencesAttribute ( string $value ) : array Get the values of all registered preferences for this user, by transforming their stored preferences and merging them with the defaults.
getSession ( ) : Symfony\Component\HttpFoundation\Session\SessionInterface
getUnreadNotificationsCount ( ) : integer Get the number of unread notifications for the user.
groups ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany Define the relationship with the user's groups.
hasPermission ( string $permission ) : boolean Check whether the user has a certain permission based on their groups.
hasPermissionLike ( string $match ) : boolean Check whether the user has a permission that is like the given string, based on their groups.
isAdmin ( ) : boolean Check whether or not the user is an administrator.
isGuest ( ) : boolean Check whether or not the user is a guest.
markAllAsRead ( ) Mark all discussions as read.
markNotificationsAsRead ( ) Mark all notifications as read.
notifications ( ) : Illuminate\Database\Eloquent\Relations\HasMany Define the relationship with the user's notifications.
permissions ( ) : Builder Define the relationship with the permissions of all of the groups that the user is in.
posts ( ) : Illuminate\Database\Eloquent\Relations\HasMany Define the relationship with the user's posts.
read ( ) : BelongsTo Define the relationship with the user's read discussions.
register ( string $username, string $email, string $password ) : static Register a new user.
rename ( string $username ) Rename the user.
requestEmailChange ( string $email ) Request that the user's email be changed.
setGate ( Flarum\Core\Access\Gate $gate )
setHasher ( Illuminate\Contracts\Hashing\Hasher $hasher ) Set the hasher with which to hash passwords.
setPasswordAttribute ( string $value ) Set the password attribute, storing it as a hash.
setPreference ( string $key, mixed $value ) Set the value of a preference for this user.
setPreferencesAttribute ( mixed $value ) Encode an array of preferences for storage in the database.
setSession ( Symfony\Component\HttpFoundation\Session\SessionInterface $session )
shouldAlert ( string $type ) : boolean Check whether or not the user should receive an alert for a notification type.
shouldEmail ( string $type ) : boolean Check whether or not the user should receive an email for a notification type.
updateLastSeen ( ) Set the user as being last seen just now.

보호된 메소드들

메소드 설명
getUnreadNotifications ( ) : Illuminate\Database\Eloquent\Collection Get all notifications that have not been read yet.

메소드 상세

accessTokens() 공개 메소드

Define the relationship with the user's access tokens.
public accessTokens ( ) : Illuminate\Database\Eloquent\Relations\HasMany
리턴 Illuminate\Database\Eloquent\Relations\HasMany

activate() 공개 메소드

Activate the user's account.
public activate ( )

addPreference() 공개 정적인 메소드

Register a preference with a transformer and a default value.
public static addPreference ( string $key, callable $transformer = null, mixed $default = null )
$key string
$transformer callable
$default mixed

boot() 공개 정적인 메소드

Boot the model.
public static boot ( ) : void
리턴 void

can() 공개 메소드

public can ( string $ability, array | mixed $arguments = [] ) : boolean
$ability string
$arguments array | mixed
리턴 boolean

cannot() 공개 메소드

public cannot ( string $ability, array | mixed $arguments = [] ) : boolean
$ability string
$arguments array | mixed
리턴 boolean

changeAvatarPath() 공개 메소드

Change the path of the user avatar.
public changeAvatarPath ( string $path )
$path string

changeBio() 공개 메소드

Change the user's bio.
public changeBio ( string $bio )
$bio string

changeEmail() 공개 메소드

Change the user's email.
public changeEmail ( string $email )
$email string

changePassword() 공개 메소드

Change the user's password.
public changePassword ( string $password )
$password string

checkPassword() 공개 메소드

Check if a given password matches the user's password.
public checkPassword ( string $password ) : boolean
$password string
리턴 boolean

getAlertableNotificationTypes() 공개 메소드

Get the notification types that should be alerted to this user, according to their preferences.

getAvatarUrlAttribute() 공개 메소드

Get the URL of the user's avatar.
public getAvatarUrlAttribute ( ) : string
리턴 string

getGate() 공개 정적인 메소드

public static getGate ( ) : Flarum\Core\Access\Gate
리턴 Flarum\Core\Access\Gate

getLocaleAttribute() 공개 메소드

Get the user's locale, falling back to the forum's default if they haven't set one.
public getLocaleAttribute ( string $value ) : string
$value string
리턴 string

getNewNotificationsCount() 공개 메소드

Get the number of new, unseen notifications for the user.

getNotificationPreferenceKey() 공개 정적인 메소드

Get the key for a preference which flags whether or not the user will receive a notification for $type via $method.
public static getNotificationPreferenceKey ( string $type, string $method ) : string
$type string
$method string
리턴 string

getPermissions() 공개 메소드

Get a list of permissions that the user has.
public getPermissions ( ) : string[]
리턴 string[]

getPreference() 공개 메소드

Get the value of a preference for this user.
public getPreference ( string $key, mixed $default = null ) : mixed
$key string
$default mixed
리턴 mixed

getPreferencesAttribute() 공개 메소드

Get the values of all registered preferences for this user, by transforming their stored preferences and merging them with the defaults.
public getPreferencesAttribute ( string $value ) : array
$value string
리턴 array

getSession() 공개 메소드

public getSession ( ) : Symfony\Component\HttpFoundation\Session\SessionInterface
리턴 Symfony\Component\HttpFoundation\Session\SessionInterface

getUnreadNotifications() 보호된 메소드

Get all notifications that have not been read yet.
protected getUnreadNotifications ( ) : Illuminate\Database\Eloquent\Collection
리턴 Illuminate\Database\Eloquent\Collection

getUnreadNotificationsCount() 공개 메소드

Get the number of unread notifications for the user.

groups() 공개 메소드

Define the relationship with the user's groups.
public groups ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
리턴 Illuminate\Database\Eloquent\Relations\BelongsToMany

hasPermission() 공개 메소드

Check whether the user has a certain permission based on their groups.
public hasPermission ( string $permission ) : boolean
$permission string
리턴 boolean

hasPermissionLike() 공개 메소드

Check whether the user has a permission that is like the given string, based on their groups.
public hasPermissionLike ( string $match ) : boolean
$match string
리턴 boolean

isAdmin() 공개 메소드

Check whether or not the user is an administrator.
public isAdmin ( ) : boolean
리턴 boolean

isGuest() 공개 메소드

Check whether or not the user is a guest.
public isGuest ( ) : boolean
리턴 boolean

markAllAsRead() 공개 메소드

Mark all discussions as read.
public markAllAsRead ( )

markNotificationsAsRead() 공개 메소드

Mark all notifications as read.

notifications() 공개 메소드

Define the relationship with the user's notifications.
public notifications ( ) : Illuminate\Database\Eloquent\Relations\HasMany
리턴 Illuminate\Database\Eloquent\Relations\HasMany

permissions() 공개 메소드

Define the relationship with the permissions of all of the groups that the user is in.
public permissions ( ) : Builder
리턴 Illuminate\Database\Eloquent\Builder

posts() 공개 메소드

Define the relationship with the user's posts.
public posts ( ) : Illuminate\Database\Eloquent\Relations\HasMany
리턴 Illuminate\Database\Eloquent\Relations\HasMany

read() 공개 메소드

Define the relationship with the user's read discussions.
public read ( ) : BelongsTo
리턴 Illuminate\Database\Eloquent\Relations\BelongsTo

register() 공개 정적인 메소드

Register a new user.
public static register ( string $username, string $email, string $password ) : static
$username string
$email string
$password string
리턴 static

rename() 공개 메소드

Rename the user.
public rename ( string $username )
$username string

requestEmailChange() 공개 메소드

Request that the user's email be changed.
public requestEmailChange ( string $email )
$email string

setGate() 공개 정적인 메소드

public static setGate ( Flarum\Core\Access\Gate $gate )
$gate Flarum\Core\Access\Gate

setHasher() 공개 정적인 메소드

Set the hasher with which to hash passwords.
public static setHasher ( Illuminate\Contracts\Hashing\Hasher $hasher )
$hasher Illuminate\Contracts\Hashing\Hasher

setPasswordAttribute() 공개 메소드

Set the password attribute, storing it as a hash.
public setPasswordAttribute ( string $value )
$value string

setPreference() 공개 메소드

Set the value of a preference for this user.
public setPreference ( string $key, mixed $value )
$key string
$value mixed

setPreferencesAttribute() 공개 메소드

Encode an array of preferences for storage in the database.
public setPreferencesAttribute ( mixed $value )
$value mixed

setSession() 공개 메소드

public setSession ( Symfony\Component\HttpFoundation\Session\SessionInterface $session )
$session Symfony\Component\HttpFoundation\Session\SessionInterface

shouldAlert() 공개 메소드

Check whether or not the user should receive an alert for a notification type.
public shouldAlert ( string $type ) : boolean
$type string
리턴 boolean

shouldEmail() 공개 메소드

Check whether or not the user should receive an email for a notification type.
public shouldEmail ( string $type ) : boolean
$type string
리턴 boolean

updateLastSeen() 공개 메소드

Set the user as being last seen just now.
public updateLastSeen ( )

프로퍼티 상세

$dates 보호되어 있는 프로퍼티

protected $dates

$gate 보호되어 있는 정적으로 프로퍼티

The access gate.
protected static Gate,Flarum\Core\Access $gate
리턴 Flarum\Core\Access\Gate

$hasher 보호되어 있는 정적으로 프로퍼티

The hasher with which to hash passwords.
protected static Hasher,Illuminate\Contracts\Hashing $hasher
리턴 Illuminate\Contracts\Hashing\Hasher

$permissions 보호되어 있는 프로퍼티

An array of permissions that this user has.
protected string[]|null $permissions
리턴 string[] | null

$preferences 보호되어 있는 정적으로 프로퍼티

- transformer: a callback that confines the value of the preference - default: a default value if the preference isn't set
protected static array $preferences
리턴 array

$session 보호되어 있는 프로퍼티

protected SessionInterface,Symfony\Component\HttpFoundation\Session $session
리턴 Symfony\Component\HttpFoundation\Session\SessionInterface

$table 보호되어 있는 프로퍼티

protected $table