PHP 클래스 ElggUser, Elgg

Representation of a "user" in the system.
상속: extends ElggEntity, implements Friendable
파일 보기 프로젝트 열기: elgg/elgg 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( stdClass $row = null ) Construct a new user entity
__set ( $name, $value )
addFriend ( integer $friend_guid, boolean $create_river_item = false ) : boolean Adds a user as a friend
ban ( string $reason = "" ) : boolean Ban this user.
canComment ( integer $user_guid, boolean $default = null ) : boolean Can a user comment on this user?
getDisplayName ( )
getExternalAttributes ( ) : array Get default values for attributes stored in a separate table
getFriends ( array $options = [] )
getFriendsObjects ( array $options = [] )
getFriendsOf ( array $options = [] )
getGroups ( array $options = [] ) : array | false Gets the user's groups
getNotificationSettings ( ) : array Returns users's notification settings [ 'email' => true, // enabled 'ajax' => false, // disabled ]
getObjects ( array $options = [] )
getOwnerGUID ( ) : integer Get a user's owner GUID
isAdmin ( ) : boolean Is this user admin?
isBanned ( ) : boolean Is this user banned or not?
isFriend ( ) : boolean Determines whether or not this user is a friend of the currently logged in user
isFriendOf ( integer $user_guid ) : boolean Determines whether or not this user is another user's friend
isFriendsWith ( integer $user_guid ) : boolean Determines whether this user is friends with another user
makeAdmin ( ) : boolean Make the user an admin
removeAdmin ( ) : boolean Remove the admin flag for user
removeFriend ( integer $friend_guid ) : boolean Removes a user as a friend
setDisplayName ( $displayName )
setNotificationSetting ( string $method, boolean $enabled = true ) : boolean Enable or disable a notification delivery method
setPassword ( string $password ) : void Set the necessary attribute to store a hash of the user's password.
unban ( ) : boolean Unban this user.

보호된 메소드들

메소드 설명
create ( )
initializeAttributes ( ) : void Initialize the attributes array.
load ( mixed $guid ) : boolean Load the \ElggUser data from the database
prepareObject ( $object )
update ( )

메소드 상세

__construct() 공개 메소드

Plugin developers should only use the constructor to create a new entity. To retrieve entities, use get_entity() and the elgg_get_entities* functions.
public __construct ( stdClass $row = null )
$row stdClass Database row result. Default is null to create a new user.

__set() 공개 메소드

public __set ( $name, $value )

addFriend() 공개 메소드

Adds a user as a friend
public addFriend ( integer $friend_guid, boolean $create_river_item = false ) : boolean
$friend_guid integer The GUID of the user to add
$create_river_item boolean Create the river item announcing this friendship
리턴 boolean

ban() 공개 메소드

Ban this user.
public ban ( string $reason = "" ) : boolean
$reason string Optional reason
리턴 boolean

canComment() 공개 메소드

Can a user comment on this user?
또한 보기: ElggEntity::canComment()
부터: 1.8.0
public canComment ( integer $user_guid, boolean $default = null ) : boolean
$user_guid integer User guid (default is logged in user)
$default boolean Default permission
리턴 boolean

create() 보호된 메소드

protected create ( )

getDisplayName() 공개 메소드

public getDisplayName ( )

getExternalAttributes() 최종 공개 정적인 메소드

Get default values for attributes stored in a separate table
또한 보기: Elgg\Database\EntityTable::getEntities
final public static getExternalAttributes ( ) : array
리턴 array

getFriends() 공개 메소드

public getFriends ( array $options = [] )
$options array

getFriendsObjects() 공개 메소드

public getFriendsObjects ( array $options = [] )
$options array

getFriendsOf() 공개 메소드

public getFriendsOf ( array $options = [] )
$options array

getGroups() 공개 메소드

Gets the user's groups
public getGroups ( array $options = [] ) : array | false
$options array Options array.
리턴 array | false Array of \ElggGroup, or false, depending on success

getNotificationSettings() 공개 메소드

Returns users's notification settings [ 'email' => true, // enabled 'ajax' => false, // disabled ]
public getNotificationSettings ( ) : array
리턴 array

getObjects() 공개 메소드

public getObjects ( array $options = [] )
$options array

getOwnerGUID() 공개 메소드

Returns it's own GUID if the user is not owned.
public getOwnerGUID ( ) : integer
리턴 integer

initializeAttributes() 보호된 메소드

This is vital to distinguish between metadata and base attributes.
protected initializeAttributes ( ) : void
리턴 void

isAdmin() 공개 메소드

Is this user admin?
public isAdmin ( ) : boolean
리턴 boolean

isBanned() 공개 메소드

Is this user banned or not?
public isBanned ( ) : boolean
리턴 boolean

isFriend() 공개 메소드

Determines whether or not this user is a friend of the currently logged in user
public isFriend ( ) : boolean
리턴 boolean

isFriendOf() 공개 메소드

Determines whether or not this user is another user's friend
public isFriendOf ( integer $user_guid ) : boolean
$user_guid integer The GUID of the user to check against
리턴 boolean

isFriendsWith() 공개 메소드

Determines whether this user is friends with another user
public isFriendsWith ( integer $user_guid ) : boolean
$user_guid integer The GUID of the user to check against
리턴 boolean

load() 보호된 메소드

Load the \ElggUser data from the database
protected load ( mixed $guid ) : boolean
$guid mixed \ElggUser GUID or \stdClass database row from entity table
리턴 boolean

makeAdmin() 공개 메소드

Make the user an admin
public makeAdmin ( ) : boolean
리턴 boolean

prepareObject() 보호된 메소드

protected prepareObject ( $object )

removeAdmin() 공개 메소드

Remove the admin flag for user
public removeAdmin ( ) : boolean
리턴 boolean

removeFriend() 공개 메소드

Removes a user as a friend
public removeFriend ( integer $friend_guid ) : boolean
$friend_guid integer The GUID of the user to remove
리턴 boolean

setDisplayName() 공개 메소드

public setDisplayName ( $displayName )

setNotificationSetting() 공개 메소드

Enable or disable a notification delivery method
public setNotificationSetting ( string $method, boolean $enabled = true ) : boolean
$method string Method name
$enabled boolean Enabled or disabled
리턴 boolean

setPassword() 공개 메소드

Set the necessary attribute to store a hash of the user's password.
부터: 1.10.0
public setPassword ( string $password ) : void
$password string The password to be hashed
리턴 void

unban() 공개 메소드

Unban this user.
public unban ( ) : boolean
리턴 boolean

update() 보호된 메소드

protected update ( )