Пример #1
0
 public static function getRequestsByUserId($userId)
 {
     $join = new Sabel_Db_Join("Request");
     $join->setCondition("Request.request_id", $userId);
     $join->setOrderBy("Request.created_at", "desc");
     return $join->add("User")->select();
 }
Пример #2
0
 public static function getFriends($userId, $limit)
 {
     $join = new Sabel_Db_Join(new self());
     $join->add("Users", "", array("id" => "uid", "fkey" => "follow_id"));
     $join->setCondition("Follower.user_id", $userId);
     $join->setOrderBy("Follower.created_at");
     $join->setLimit($limit);
     return $join->select();
 }
Пример #3
0
 public function testBridgeCount()
 {
     $join = new Sabel_Db_Join("StudentCourse");
     $join->setCondition("Student.id", 3);
     $this->assertEquals(3, $join->add("Student")->add("Course")->getCount());
 }