20 public function addFriend(
int $friend_guid,
bool $create_river_item =
false) {
25 if (!$this->addRelationship($friend_guid,
'friend')) {
29 if ($create_river_item) {
31 'view' =>
'river/relationship/friend/create',
32 'action_type' =>
'friend',
33 'subject_guid' => $this->guid,
34 'object_guid' => $friend_guid,
48 public function removeFriend(
int $friend_guid): bool {
49 return $this->removeRelationship($friend_guid,
'friend');
58 public function isFriend(): bool {
59 elgg_deprecated_notice(__CLASS__ .
'->' . __FUNCTION__ .
'() has been deprecated. Use ' . __CLASS__ .
'->isFriendOf()',
'4.3');
61 return $this->isFriendOf(
_elgg_services()->session->getLoggedInUserGuid());
71 public function isFriendsWith(
int $user_guid): bool {
72 return $this->hasRelationship($user_guid,
'friend');
82 public function isFriendOf(
int $user_guid): bool {
83 return (
bool)
_elgg_services()->relationshipsTable->check($user_guid,
'friend', $this->guid);
96 public function getFriends(array
$options = []) {
97 elgg_deprecated_notice(__CLASS__ .
'->' . __FUNCTION__ .
'() has been deprecated. Use ' . __CLASS__ .
'->getEntitiesFromRelationship()',
'4.3');
117 public function getFriendsOf(array
$options = []) {
118 elgg_deprecated_notice(__CLASS__ .
'->' . __FUNCTION__ .
'() has been deprecated. Use ' . __CLASS__ .
'->getEntitiesFromRelationship()',
'4.3');
120 $options[
'relationship'] =
'friend';
122 $options[
'inverse_relationship'] =
true;
139 public function getFriendsObjects(array
$options = []) {
140 elgg_deprecated_notice(__CLASS__ .
'->' . __FUNCTION__ .
'() has been deprecated. Use ' . __CLASS__ .
'->getEntitiesFromRelationship()',
'4.3');
143 $options[
'relationship'] =
'friend';
145 $options[
'relationship_join_on'] =
'container_guid';
get_user($guid)
Get a user object from a GUID.
elgg_deprecated_notice(string $msg, string $dep_version)
Log a notice about deprecated use of a function, view, etc.
elgg_create_river_item(array $options=[])
Elgg river.
$friend_guid
Assembles and outputs the registration page.
elgg_get_entities(array $options=[])
Fetches/counts entities or performs a calculation on their properties.
_elgg_services()
Get the global service provider.
$guid
Reset an ElggUpgrade.