Beispiel #1
0
 /**
  * @test
  */
 public function getFriendIds()
 {
     $user2 = $this->getUser("test2");
     $ids = Follower::getFriendIds($user2->id);
     $this->eq(2, count($ids));
     $this->eq($this->getUser("test1")->id, $ids[0]);
     $this->eq($this->getUser("test3")->id, $ids[1]);
 }
Beispiel #2
0
 public function getFriendsAndMyStatuses($userId, $params, $limit = null)
 {
     if ($limit === null) {
         $limit = self::DEFAULT_ITEM_LIMIT;
     }
     $ids = Follower::getFriendIds($userId);
     $ids[] = $userId;
     $join = new Sabel_Db_Join("Status");
     $paginator = new Paginator($join->add("Users"));
     $paginator->setCondition(C::create(C::IN, "Users.uid", $ids));
     $paginator->setDefaultOrder("Status.created_at", "desc");
     return $paginator->build($limit, $params);
 }