PHP Interface Friendable, Elgg

ファイルを表示 Open project: elgg/elgg

Public Methods

Method Description
addFriend ( integer $friend_guid ) : boolean Adds a user as a friend
getFriends ( array $options = [] ) : array | false Gets this entity's friends
getFriendsObjects ( array $options = [] ) : array | false Get an array of \ElggObjects owned by this entity's friends.
getFriendsOf ( array $options = [] ) : array | false Gets users who have made this entity a friend
getObjects ( array $options = [] ) : array | false Get an array of \ElggObject owned by this entity.
isFriend ( ) : boolean Determines whether or not the current user is a friend of this entity
isFriendOf ( integer $user_guid ) : boolean Determines whether or not a foreign entity has made this one a friend
isFriendsWith ( integer $user_guid ) : boolean Determines whether or not this entity is friends with a particular entity
removeFriend ( integer $friend_guid ) : boolean Removes a user as a friend

Method Details

addFriend() public method

Adds a user as a friend
public addFriend ( integer $friend_guid ) : boolean
$friend_guid integer The GUID of the user to add
return boolean

getFriends() public method

Gets this entity's friends
public getFriends ( array $options = [] ) : array | false
$options array Options array. See elgg_get_entities_from_relationship() for a list of options. 'relationship_guid' is set to this entity, relationship name to 'friend' and type to 'user'.
return array | false Array of \ElggUser, or false, depending on success

getFriendsObjects() public method

Get an array of \ElggObjects owned by this entity's friends.
public getFriendsObjects ( array $options = [] ) : array | false
$options array Options array. See elgg_get_entities_from_relationship() for a list of options. 'relationship_guid' is set to this entity, type to 'object', relationship name to 'friend' and relationship_join_on to 'container_guid'.
return array | false

getFriendsOf() public method

Gets users who have made this entity a friend
public getFriendsOf ( array $options = [] ) : array | false
$options array Options array. See elgg_get_entities_from_relationship() for a list of options. 'relationship_guid' is set to this entity, relationship name to 'friend', type to 'user' and inverse_relationship to true.
return array | false Array of \ElggUser, or false, depending on success

getObjects() public method

Get an array of \ElggObject owned by this entity.
public getObjects ( array $options = [] ) : array | false
$options array Options array. See elgg_get_entities() for a list of options. 'type' is set to object and owner_guid to this entity.
return array | false

isFriend() public method

Determines whether or not the current user is a friend of this entity
public isFriend ( ) : boolean
return boolean

isFriendOf() public method

Determines whether or not a foreign entity has made this one a friend
public isFriendOf ( integer $user_guid ) : boolean
$user_guid integer The GUID of the foreign entity
return boolean

isFriendsWith() public method

Determines whether or not this entity is friends with a particular entity
public isFriendsWith ( integer $user_guid ) : boolean
$user_guid integer The GUID of the entity this entity may or may not be friends with
return boolean

removeFriend() public method

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