ElggUser::isFriendsWith PHP Method

isFriendsWith() public method

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
return boolean
    public function isFriendsWith($user_guid)
    {
        return (bool) check_entity_relationship($this->guid, "friend", $user_guid);
    }

Usage Example

Exemplo n.º 1
0
 public function testFriendSubscriptionRemovedWhenFriendRelationshipDeleted()
 {
     $this->user1->addFriend($this->user2->guid);
     $this->assertTrue($this->user1->isFriendsWith($this->user2->guid));
     elgg_add_subscription($this->user1->guid, 'test', $this->user2->guid);
     $this->assertIsA(check_entity_relationship($this->user1->guid, 'notifytest', $this->user2->guid), ElggRelationship::class);
     $this->user1->removeFriend($this->user2->guid);
     $this->assertFalse($this->user1->isFriendsWith($this->user2->guid));
     $this->assertFalse(check_entity_relationship($this->user1->guid, 'notifytest', $this->user2->guid));
 }
All Usage Examples Of ElggUser::isFriendsWith