本文整理汇总了PHP中sfDoctrinePager类的典型用法代码示例。如果您正苦于以下问题:PHP sfDoctrinePager类的具体用法?PHP sfDoctrinePager怎么用?PHP sfDoctrinePager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了sfDoctrinePager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例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: listRecentChangesPager
/**
* Retrieves a pager of recent associations
* @param string model name
* @return Pager
*/
public static function listRecentChangesPager($doc_id = null, $users = null, $orderby = null, $npp = 25)
{
// TODO: possibility to filter on association type?
$pager = new sfDoctrinePager('AssociationLog', $npp);
$q = $pager->getQuery();
$q->select('al.*, mi.name, mi.search_name, li.name, li.search_name, u.username, u.login_name, u.topo_name')->from('AssociationLog al')->leftJoin('al.mainI18n mi')->leftJoin('al.linkedI18n li')->leftJoin('al.user_private_data u');
// filter on a specific doc if needed
if ($doc_id) {
$q->addWhere('al.main_id=? OR al.linked_id=?', array($doc_id, $doc_id));
}
// filter on a specific user if needed
if ($users) {
$users = explode('-', $users);
if (count($users)) {
$where_ids = array();
foreach ($users as $uid) {
$where_ids[] = '?';
}
$where_ids = implode(', ', $where_ids);
if (count($where_ids) == 1) {
$where = ' = ' . $where_ids;
} else {
$where = ' IN ( ' . $where_ids . ' )';
}
$q->addWhere('u.id' . $where, $users);
}
}
if (empty($orderby)) {
$q->orderBy('al.associations_log_id DESC');
// ~ decreasing time (but faster, since there is an index on this field).
} elseif ($orderby == 'uid') {
$q->orderBy('u.id ASC');
}
return $pager;
}
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:40,代码来源:AssociationLog.class.php
示例4: buildDataGrid
public function buildDataGrid(sfWebRequest $request)
{
if ($this->table_method) {
$typeTable = Doctrine_Core::getTable($this->ContentType->name);
$method = $this->table_method;
$q = $typeTable->{$method}($this, $request);
if ($q instanceof sfSympalDataGrid) {
$dataGrid = $q;
} else {
if ($q instanceof sfDoctrinePager || $q instanceof Doctrine_Query_Abstract) {
$dataGrid = sfSympalDataGrid::create($q);
} else {
throw new sfException(sprintf('ContentList table_method must return an instance of sfSympalDataGrid, sfDoctrinePager or Doctrine_Query_Abstract. An instance of "%s" was returned.', get_class($q)));
}
}
} else {
$pager = new sfDoctrinePager('sfSympalContent');
$pager->setQuery($this->_buildQuery($request));
$dataGrid = sfSympalDataGrid::create($pager)->addColumn('c.title', 'renderer=sympal_data_grid/default_title')->addColumn('c.date_published')->addColumn('u.username', 'label=Created By');
}
if ($this->sort_column) {
$dataGrid->setDefaultSort($this->sort_column, $this->sort_order);
}
$dataGrid->setMaxPerPage($this->rows_per_page > 0 ? $this->rows_per_page : sfSympalConfig::get('rows_per_page', null, 10));
$dataGridRequestInfo = $request->getParameter($dataGrid->getId());
return $dataGrid;
}
开发者ID:slemoigne,项目名称:sympal,代码行数:27,代码来源:PluginsfSympalContentList.class.php
示例5: get_sympal_pager_navigation
/**
* Get the navigation links for given sfDoctrinePager instance
*
* @param sfDoctrinePager $pager
* @param string $uri The uri to prefix to the links
* @return string $html
*/
function get_sympal_pager_navigation($pager, $uri, $requestKey = 'page')
{
sympal_use_stylesheet('/sfSympalPlugin/css/pager.css');
$navigation = '<div class="sympal_pager_navigation">';
if ($pager->haveToPaginate()) {
$uri .= (preg_match('/\\?/', $uri) ? '&' : '?') . $requestKey . '=';
// First and previous page
if ($pager->getPage() != 1) {
$navigation .= link_to(image_tag('/sf/sf_admin/images/first.png', 'align=absmiddle'), $uri . '1');
$navigation .= link_to(image_tag('/sf/sf_admin/images/previous.png', 'align=absmiddle'), $uri . $pager->getPreviousPage()) . ' ';
}
// Pages one by one
$links = array();
foreach ($pager->getLinks() as $page) {
$links[] = '<span>' . link_to_unless($page == $pager->getPage(), $page, $uri . $page) . '</span>';
}
$navigation .= join(' ', $links);
// Next and last page
if ($pager->getPage() != $pager->getLastPage()) {
$navigation .= ' ' . link_to(image_tag('/sf/sf_admin/images/next.png', 'align=absmiddle'), $uri . $pager->getNextPage());
$navigation .= link_to(image_tag('/sf/sf_admin/images/last.png', 'align=absmiddle'), $uri . $pager->getLastPage());
}
}
$navigation .= '</div>';
return $navigation;
}
开发者ID:RafalJachimczyk,项目名称:sympal,代码行数:33,代码来源:SympalPagerHelper.php
示例6: 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
示例7: 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
示例8: 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
示例9: 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
示例10: 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
示例11: getMangaListPagerByMemberId
public function getMangaListPagerByMemberId($memberId, $page = 1, $size = 20)
{
$q = $this->createQuery()->where('member_id', $memberId)->orderBy('updated_at');
$pager = new sfDoctrinePager('CcccManga', $size);
$pager->setQuery($q);
$pager->setPage($page);
$pager->init();
return $pager;
}
开发者ID:nothan,项目名称:opCCCCPlugin,代码行数:9,代码来源:PluginCcccMangaTable.class.php
示例12: getPager
protected function getPager( $size = 50 )
{
$pager = new sfDoctrinePager('dsPerson', $size); // adusting size possible !! set 0 to deactivate
$pager->setQuery($this->buildQuery());
$pager->setPage($this->getRequest()->getParameter('page'));
$pager->init();
return $pager;
}
开发者ID:romankallweit,项目名称:swingmachine,代码行数:9,代码来源:actions.class.php
示例13: getListPager
public function getListPager($memberId, $page = 1, $size = 20)
{
$pager = new sfDoctrinePager('OpenIDTrustLog', $size);
$q = $this->createQuery()->andWhere('member_id = ?', $memberId);
$pager->setQuery($q);
$pager->setPage($page);
$pager->init();
return $pager;
}
开发者ID:te-koyama,项目名称:openpne,代码行数:9,代码来源:OpenIDTrustLogTable.class.php
示例14: 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
示例15: 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
示例16: getForUserPager
public function getForUserPager($user_id, $page = 1, $max_per_page = 10)
{
$q = $this->getForUserCriteria($user_id);
$pager = new sfDoctrinePager('sfSimpleForumTopic', $max_per_page);
$pager->setPage($page);
$pager->setQuery($q);
$pager->init();
return $pager;
}
开发者ID:j0k3r,项目名称:sfDoctrineSimpleForumPlugin,代码行数:9,代码来源:PluginsfSimpleForumTopicTable.class.php
示例17: 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
示例18: 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
示例19: 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
示例20: 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
注:本文中的sfDoctrinePager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论