/** * Set the owner of this entity to a particular user * * @param User $owner * @return true|false */ function setOwner($owner) { if ($owner instanceof \Idno\Entities\User) { $this->owner = $owner->getUUID(); return true; } else { $this->owner = $owner; } return false; }
/** * Is the given user a followed by this user? * * @param \Idno\Entities\User|string $user * @return bool */ function isFollowing($user) { if ($user instanceof \Idno\Entities\User) { if (in_array($user->getUUID(), $this->getFollowingUUIDs())) { return true; } } return false; }
/** * Is the given user a friend of this user? * * @param \Idno\Entities\User $friend * @return bool */ function isFriend($friend) { if ($friend instanceof \Idno\Entities\User) { if (in_array($friend->getUUID(), $this->getFriendIDs())) { return true; } } return false; }