本文整理匯總了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;
}
示例2: getPager
public function getPager()
{
$pager = new sfDoctrinePager('NewItem', 5);
$pager->setQuery($this->getNewsQuery());
$pager->setPage($this->getRequestParameter('page', 1));
$pager->init();
return $pager;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例12: getTrackPager
public function getTrackPager( $page = 0 )
{
$pager = new sfDoctrinePager('dsClass', 20);
$pager->setQuery( $this->getTrackQuery() );
$pager->setPage( $page );
$pager->init();
return $pager;
}
示例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;
}
示例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;
}
示例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;
}