public function getBbsCommentListPager($bbsId, $page = 1, $size = 20, $order = 'DESC')
 {
     $q = $this->createQuery()->where('bbs_id = ?', $bbsId);
     $pager = new sfReversibleDoctrinePager('BbsComment', $size);
     $pager->setQuery($q);
     $pager->setPage($page);
     $pager->setSqlOrderColumn('id');
     $pager->setSqlOrder($order);
     $pager->setListOrder(sfReversibleDoctrinePager::ASC);
     $pager->setMaxPerPage($size);
     $pager->init();
     return $pager;
 }
 protected function getPager(sfWebRequest $request)
 {
     $q = Doctrine::getTable('DiaryComment')->createQuery()->where('diary_id = ?', $this->diary->id);
     $pager = new sfReversibleDoctrinePager('DiaryComment');
     $pager->setQuery($q);
     $pager->setPage($request['page']);
     $pager->setSqlOrderColumn('number');
     $pager->setSqlOrder($this->order);
     $pager->setListOrder(sfReversibleDoctrinePager::ASC);
     if ($this->size) {
         $pager->setMaxPerPage($this->size);
     }
     return $pager;
 }
 /**
  * get member messages pager
  *
  * @param string $memberId
  * @param mixed $myMemberId (string|null)
  * @param bool $isAddLow
  * @param mixed $keyId (string|null)
  * @param integer $size
  * @return sfReversibleDoctrinePager
  */
 public function getMemberMessagesPager($memberId, $myMemberId = null, $isAddLow = true, $keyId = null, $size = 25)
 {
     $q = $this->createSendAndReceiveQuery($memberId, $myMemberId);
     $order = sfReversibleDoctrinePager::ASC;
     if ($keyId) {
         if ($isAddLow) {
             $q->andWhere('m2.id > ?', $keyId);
         } else {
             $order = sfReversibleDoctrinePager::DESC;
             $q->andWhere('m2.id < ?', $keyId);
         }
     }
     $pager = new sfReversibleDoctrinePager('MessageSendList', $size);
     $pager->setQuery($q);
     $pager->setPage(1);
     $pager->setSqlOrderColumn('id');
     $pager->setSqlOrder(sfReversibleDoctrinePager::DESC);
     $pager->setListOrder($order);
     $pager->setMaxPerPage($size);
     $pager->init();
     return $pager;
 }