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


PHP sfDoctrinePager::init方法代碼示例

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


在下文中一共展示了sfDoctrinePager::init方法的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

 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

示例3: 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

示例4: 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

示例5: getPager

 protected function getPager(Doctrine_Query $q, $page, $size)
 {
     $pager = new sfDoctrinePager('File', $size);
     $pager->setQuery($q);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
開發者ID:phenom,項目名稱:OpenPNE3,代碼行數:8,代碼來源:FileTable.class.php

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: getTrackPager

  public function getTrackPager( $page = 0 )
  {
    $pager = new sfDoctrinePager('dsClass', 20);
    $pager->setQuery( $this->getTrackQuery() );
    $pager->setPage( $page );
    $pager->init();

    return $pager;
  }
開發者ID:romankallweit,項目名稱:swingmachine,代碼行數:9,代碼來源:dsWorkshop.class.php

示例13: 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

示例14: getMemberPluginPager

 public function getMemberPluginPager($memberId, $page = 1, $size = 20)
 {
     $q = $this->createQuery()->where('id IN (SELECT pm.package_id FROM PluginMember pm WHERE pm.member_id = ? AND pm.is_active = ?)', array($memberId, true));
     $pager = new sfDoctrinePager('PluginPackage', $size);
     $pager->setQuery($q);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
開發者ID:balibali,項目名稱:opPluginChannelServerPlugin,代碼行數:9,代碼來源:PluginPluginPackageTable.class.php

示例15: getDraftMessagePager

 /**
  * 下書きメッセージ一覧
  * @param $member_id
  * @param $page
  * @param $size
  * @return Message object(の配列)
  */
 public function getDraftMessagePager($member_id, $page = 1, $size = 20)
 {
     $q = $this->createQuery()->andWhere('member_id = ?', $member_id)->andWhere('is_deleted = ?', false)->andWhere('is_send = ?', false)->orderBy('created_at DESC');
     $pager = new sfDoctrinePager('SendMessageData', $size);
     $pager->setQuery($q);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
開發者ID:te-koyama,項目名稱:openpne,代碼行數:16,代碼來源:PluginSendMessageDataTable.class.php


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