20 $relationship_object = $event->getObject();
25 if ($relationship_object->relationship !==
'friend') {
30 $friend =
get_user($relationship_object->guid_two);
32 if (!
$user || !$friend) {
36 $acl =
$user->getOwnedAccessCollection(
'friends');
41 $acl->addMember($friend->guid);
__invoke(\Elgg\Event $event)
Adds the friend to the user friend ACL.
get_user(int $guid)
Elgg users Functions to manage multiple or single users in an Elgg install.
Models an event passed to event handlers.