コード例 #1
0
ファイル: Entity.php プロジェクト: sensiblemn/Known
 /**
  * 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;
 }
コード例 #2
0
ファイル: User.php プロジェクト: smartboyathome/Known
 /**
  * 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;
 }
コード例 #3
0
ファイル: User.php プロジェクト: phpsource/idno
 /**
  * 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;
 }