當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sfDoctrinePager::setPage方法代碼示例

本文整理匯總了PHP中sfDoctrinePager::setPage方法的典型用法代碼示例。如果您正苦於以下問題:PHP sfDoctrinePager::setPage方法的具體用法?PHP sfDoctrinePager::setPage怎麽用?PHP sfDoctrinePager::setPage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sfDoctrinePager的用法示例。


在下文中一共展示了sfDoctrinePager::setPage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getPager

 /**
  * Fetch images from pool according to any default tag(s) option specified 
  * in the global schema.yml.
  * Override added to specify per tag in MooEditable
  * 
  * @return sfDoctrinePager
  */
 public function getPager($per_page = 12, $page = 1, $tagged_object = null, $tag = null)
 {
     $pager = new sfDoctrinePager($this->getClassnameToReturn(), $per_page);
     $im = new sfImagePoolImage();
     if (!$im->option('tagging')) {
         $tagged_object = $tag = null;
     }
     $im->free(true);
     if (isset($tagged_object) && ($tag = $tagged_object->getTagRestriction())) {
         $query = TagTable::getObjectTaggedWithQuery($this->getClassnameToReturn(), $tag, $pager->getQuery(), array('nb_common_tags' => 1));
         $pager->setQuery($query);
     } else {
         if (!empty($tag)) {
             // If only tags we have no taggable object
             // So get images tagged with this query and do a whereIn on the ids
             $tags = explode(',', $tag);
             $images = TagTable::getObjectTaggedWith($tags, array('model' => 'sfImagePoolImage', 'nb_common_tags' => 1));
             $image_ids = array();
             foreach ($images as $image) {
                 $image_ids[] = $image->id;
             }
             if (!empty($image_ids)) {
                 $pager->getQuery()->whereIn('sfImagePoolImage.id', $image_ids);
             } else {
                 $pager->getQuery()->where('false');
             }
             // we have no images tagged
         }
     }
     $pager->getQuery()->orderBy('updated_at DESC');
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
開發者ID:nixilla,項目名稱:sfImagePoolPlugin,代碼行數:41,代碼來源:PluginsfImagePoolImageTable.class.php

示例2: getPager

 protected function getPager(Doctrine_Query $q, $page, $size)
 {
     $pager = new sfDoctrinePager('Bbs', $size);
     $pager->setQuery($q);
     $pager->setPage($page);
     return $pager;
 }
開發者ID:uzura8,項目名稱:opSimpleBbsPlugin,代碼行數:7,代碼來源:PluginBbsTable.class.php

示例3: getPager

 /**
  *
  * @return sfDoctrinePager
  */
 protected function getPager()
 {
     $p = new sfDoctrinePager('sfGuardUser', 10);
     $p->setQuery($this->getQuery());
     $p->setPage($this->getPage());
     return $p;
 }
開發者ID:JoshuaEstes,項目名稱:Office-Merit-Badges,代碼行數:11,代碼來源:actions.class.php

示例4: getPager

 public function getPager()
 {
     $pager = new sfDoctrinePager('NewItem', 5);
     $pager->setQuery($this->getNewsQuery());
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     return $pager;
 }
開發者ID:vcgato29,項目名稱:poff,代碼行數:8,代碼來源:components.class.php

示例5: getPager

 public function getPager(Member $member, $page = 1, $size = 20)
 {
     $q = $this->getQuery($member);
     $pager = new sfDoctrinePager('DiaryCommentUpdate', $size);
     $pager->setQuery($q);
     $pager->setPage($page);
     return $pager;
 }
開發者ID:meruto,項目名稱:opDiaryPlugin,代碼行數:8,代碼來源:PluginDiaryCommentUpdateTable.class.php

示例6: getPager

 protected function getPager(Doctrine_Query $query)
 {
     $pager = new sfDoctrinePager('Fortune', sfConfig::get('app_fortunes_max_items', 10));
     $pager->setQuery($query);
     $pager->setPage($this->getRequest()->getParameter('page', 1));
     $pager->init();
     return $pager;
 }
開發者ID:n1k0,項目名稱:sftunes,代碼行數:8,代碼來源:actions.class.php

示例7: getResultListPager

 public function getResultListPager(Doctrine_Query $query, $page = 1, $size = 20)
 {
     $pager = new sfDoctrinePager('CommunityTopic', $size);
     $pager->setQuery($query);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
開發者ID:te-koyama,項目名稱:openpne,代碼行數:8,代碼來源:PluginCommunityTopicTable.class.php

示例8: getRecentPager

 public function getRecentPager($page = 1, $size = 20)
 {
     $pager = new sfDoctrinePager('PluginPackage', $size);
     $pager->setQuery($this->getRecentReleaseQuery($size));
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
開發者ID:balibali,項目名稱:opPluginChannelServerPlugin,代碼行數:8,代碼來源:PluginPluginReleaseTable.class.php

示例9: getPager

 protected function getPager(sfWebRequest $request)
 {
     $q = Doctrine::getTable('AlbumComment')->createQuery()->where('album_id = ?', $this->album->id)->orderBy('created_at DESC');
     $pager = new sfDoctrinePager('AlbumComment');
     $pager->setQuery($q);
     $pager->setPage($request['commentPage']);
     $pager->setMaxPerPage($this->size);
     return $pager;
 }
開發者ID:balibali,項目名稱:opAlbumPlugin,代碼行數:9,代碼來源:opAlbumPluginAlbumCommentComponents.class.php

示例10: getListPager

  /**
   * Get introFriend pager
   * @param int $memberIdTo member id
   * @param int $page page number
   * @param int $size show number
   * @return pager pager
   */
  public function getListPager($memberIdTo, $page = 1, $size = 20)
  {
    $pager = new sfDoctrinePager('IntroFriend', $size);
    $pager->setQuery($this->getListQuery($memberIdTo));
    $pager->setPage($page);
    $pager->init();

    return $pager;
  }
開發者ID:nise-nabe,項目名稱:opIntroFriendPlugin,代碼行數:16,代碼來源:PluginIntroFriendTable.class.php

示例11: getListPager

 public function getListPager($op2CommunityId, $page = 1, $size = 20)
 {
     $query = $this->createQuery()->where('op2_community_id = ?', $op2CommunityId)->orderBy('created_at DESC');
     $pager = new sfDoctrinePager('Op2CommunityEvent', $size);
     $pager->setQuery($query);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
開發者ID:upsilon,項目名稱:opMTViewerPlugin,代碼行數:9,代碼來源:PluginOp2CommunityEventTable.class.php

示例12: getListPager

 public function getListPager($page = 1, $size = 20)
 {
     $query = $this->createQuery()->orderBy('updated_at DESC');
     $pager = new sfDoctrinePager('VoteQuestion', $size);
     $pager->setQuery($query);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
開發者ID:rysk92,項目名稱:opVotePlugin,代碼行數:9,代碼來源:PluginVoteQuestionTable.class.php

示例13: getPager

 public function getPager($packageId, $page = 1, $size = 20)
 {
     $q = Doctrine::getTable('Member')->createQuery('m')->where('p.package_id = ?', $packageId)->innerJoin('m.PluginMember p');
     $pager = new sfDoctrinePager('Member', $size);
     $pager->setQuery($q);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
開發者ID:balibali,項目名稱:opPluginChannelServerPlugin,代碼行數:9,代碼來源:PluginPluginMemberTable.class.php

示例14: getMemberPager

 public function getMemberPager($memberId, $accessMemberId, $size, $page = 1)
 {
     $q = $this->createQuery("g")->where("g.member_id = ?", $memberId)->orderBy("id DESC");
     $pager = new sfDoctrinePager("Geocode", $size);
     $pager->setQuery($q);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
開發者ID:77web,項目名稱:opMapPlugin,代碼行數:9,代碼來源:PluginGeocodeTable.class.php

示例15: getPager

 /**
  * get pager for assets
  * @param  array   $params
  * @param  string  $sort
  * @param  integer $page
  * @param  integer $size
  * @return sfPager
  */
 public function getPager(array $params, $sort = 'name', $page = 1, $size = 20)
 {
     $query = $this->search($params, $sort);
     $pager = new sfDoctrinePager('sfAsset', $size);
     $pager->setQuery($query);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
開發者ID:joanteixi,項目名稱:sfDoctrineAssetsLibraryPlugin,代碼行數:17,代碼來源:PluginsfAssetTable.class.php


注:本文中的sfDoctrinePager::setPage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。