当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Paginator::setCache方法代码示例

本文整理汇总了PHP中Zend_Paginator::setCache方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Paginator::setCache方法的具体用法?PHP Zend_Paginator::setCache怎么用?PHP Zend_Paginator::setCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Paginator的用法示例。


在下文中一共展示了Zend_Paginator::setCache方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _initPaginator

 protected function _initPaginator()
 {
     $options = $this->getOptions();
     if (array_key_exists('cache', $options) && $options['cache']) {
         // ensure the cache is initialized...
         $this->getBootstrap()->bootstrap('cachemanager');
         // get the cache manager object
         $manager = $this->getBootstrap()->getResource('cachemanager');
         // get the paginator cache object
         $cache = $manager->getCache(self::PAGINATOR_CACHE);
         if (!is_null($cache)) {
             Zend_Paginator::setCache($cache);
         }
     }
     if (!empty($options['scrollingType'])) {
         Zend_Paginator::setDefaultScrollingStyle($options['scrollingType']);
     } else {
         Zend_Paginator::setDefaultScrollingStyle(self::DEFAULT_SCROLLING_TYPE);
     }
     if (!empty($options['recordsPerPage'])) {
         Zend_Paginator::setDefaultItemCountPerPage($options['recordsPerPage']);
     } else {
         Zend_Paginator::setDefaultItemCountPerPage(self::DEFAULT_RECORDS_PER_PAGE);
     }
     if (!empty($options['viewScript'])) {
         Zend_View_Helper_PaginationControl::setDefaultViewPartial($options['viewScript']);
     }
 }
开发者ID:rawatanil3,项目名称:Zend-Framework-Development-Project,代码行数:28,代码来源:Paginator.php

示例2: _initTranslation

 protected function _initTranslation()
 {
     $cache = $this->_getCache('core');
     Zend_Translate::setCache($cache);
     Zend_Date::setOptions(array('cache' => $cache));
     Zend_Paginator::setCache($cache);
 }
开发者ID:rom1git,项目名称:Centurion,代码行数:7,代码来源:Bootstrap.php

示例3: getAll

 /** Retrieval of all HERs
  * @return array $data
  */
 public function getAll($params)
 {
     $types = $this->getAdapter();
     $select = $types->select()->from($this->_name)->order('name');
     $paginator = Zend_Paginator::factory($select);
     Zend_Paginator::setCache(Zend_Registry::get('cache'));
     if (isset($params['page']) && $params['page'] != "") {
         $paginator->setCurrentPageNumber((int) $params['page']);
     }
     $paginator->setItemCountPerPage(20)->setPageRange(10);
     return $paginator;
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:15,代码来源:Hers.php

示例4: getVaTypes

 /** Get a list of va types paginated
  * @access public
  * @param array $params
  * @return array
  */
 public function getVaTypes($params)
 {
     $types = $this->getAdapter();
     $select = $types->select()->from($this->_name);
     $paginator = Zend_Paginator::factory($select);
     $paginator->setItemCountPerPage(30)->setPageRange(10);
     if (isset($params['page']) && $params['page'] != "") {
         $paginator->setCurrentPageNumber((int) $params['page']);
     }
     Zend_Paginator::setCache($this->_cache);
     return $paginator;
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:17,代码来源:VanArsdellTypes.php

示例5: getMackTypes

 /** Retrieve paginated mack types
  * @access public
  * @param integer $page
  * @return array $paginator
  */
 public function getMackTypes($params)
 {
     $types = $this->getAdapter();
     $select = $types->select()->from($this->_name)->joinLeft('coins', 'coins.mack_type = macktypes.type', array())->order($this->_name . '.type')->group($this->_name . '.type');
     $paginator = Zend_Paginator::factory($select);
     Zend_Paginator::setCache($this->_cache);
     $paginator->setItemCountPerPage(30)->setPageRange(10);
     if (isset($params['page']) && $params['page'] != "") {
         $paginator->setCurrentPageNumber($params['page']);
     }
     return $paginator;
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:17,代码来源:MackTypes.php

示例6: myIps

 /** Retrieve ip address count and addresses used per user for logins
  * @access public
  * @param string $user username
  * @return array
  */
 public function myIps($user, $page)
 {
     $logins = $this->getAdapter();
     $select = $logins->select()->from($this->_name, array('count' => 'COUNT(ipAddress)', 'ipAddress'))->where('username =  ? ', $user)->group('ipAddress')->order('id DESC');
     $paginator = Zend_Paginator::factory($select);
     $paginator->setItemCountPerPage(10)->setPageRange(10);
     Zend_Paginator::setCache($this->_cache);
     if (isset($page) && $page != "") {
         $paginator->setCurrentPageNumber($page);
     }
     return $paginator;
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:17,代码来源:Logins.php

示例7: getCurrentOpps

 /** Get all current opps as paginated list
  * @param integer $params['page'] the current page 
  * @return array
  */
 public function getCurrentOpps($params)
 {
     $vols = $this->getAdapter();
     $select = $vols->select()->from($this->_name)->joinLeft('projecttypes', $this->_name . '.suitableFor = projecttypes.id', array('type' => 'title'))->joinLeft('people', $this->_name . '.managedBy = people.secuid', array('fullname'))->where($this->_name . '.status = ?', (int) 1)->order(array($this->_name . '.created'));
     $data = $vols->fetchAll($select);
     $paginator = Zend_Paginator::factory($data);
     Zend_Paginator::setCache($this->_cache);
     if (isset($params['page']) && $params['page'] != "") {
         $paginator->setCurrentPageNumber((int) $params['page']);
     }
     $paginator->setItemCountPerPage(50)->setPageRange(10);
     return $paginator;
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:17,代码来源:Volunteers.php

示例8: listDates

 /** Get a paginated list of TVC dates
  * @access public
  * @param integer $page
  * @return \Zend_Paginator
  */
 public function listDates($page)
 {
     $tvcs = $this->getAdapter();
     $select = $tvcs->select()->from($this->_name)->joinLeft('tvcDatesToCases', 'tvcDatesToCases.tvcID = ' . $this->_name . '.secuid', array('total' => 'COUNT(*)'))->order($this->_name . '.date DESC')->group($this->_name . '.' . $this->_primary);
     $data = $tvcs->fetchAll($select);
     $paginator = Zend_Paginator::factory($data);
     Zend_Paginator::setCache($this->_cache);
     if (isset($page) && $page != "") {
         $paginator->setCurrentPageNumber((int) $page);
     }
     $paginator->setItemCountPerPage(20)->setPageRange(10);
     return $paginator;
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:18,代码来源:TvcDates.php

示例9: getMessages

 /** Retrieve all submitted error messages so far
  * @param array $params
  * @return object $paginator
  */
 public function getMessages($params)
 {
     $messages = $this->getAdapter();
     $select = $messages->select()->from($this->_name)->joinLeft('finds', 'finds.id = comment_findID', array('broadperiod', 'objecttype', 'old_findID'))->order($this->_name . '.id DESC');
     $data = $messages->fetchAll($select);
     $paginator = Zend_Paginator::factory($data);
     Zend_Paginator::setCache($this->_cache);
     $paginator->setItemCountPerPage(20)->setPageRange(10);
     if (isset($params['page']) && $params['page'] != "") {
         $paginator->setCurrentPageNumber((int) $params['page']);
     }
     return $paginator;
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:17,代码来源:ErrorReports.php

示例10: getValidInsts

 /** Get paginated list of institutions that are valid
  * @access public
  * @param array $params
  * @return \Zend_Paginator $paginator
  */
 public function getValidInsts($params)
 {
     $roles = $this->getAdapter();
     $select = $roles->select()->from($this->_name)->joinLeft('users', 'users.id = ' . $this->_name . '.createdBy', array('fullname'))->joinLeft('users', 'users_2.id = ' . $this->_name . '.updatedBy', array('fn' => 'fullname'));
     $data = $roles->fetchAll($select);
     $paginator = Zend_Paginator::factory($data);
     Zend_Paginator::setCache(Zend_Registry::get('cache'));
     if (isset($params['page']) && $params['page'] != "") {
         $paginator->setCurrentPageNumber((int) $params['page']);
     }
     $paginator->setItemCountPerPage(20)->setPageRange(10);
     return $paginator;
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:18,代码来源:Institutions.php

示例11: getUsersAdmin

 /** Retrieve a list of users and paginate
  * @access public
  * @param type $params
  * @return \Zend_Paginator
  */
 public function getUsersAdmin(array $params)
 {
     $select = $this->select()->from($this->_name)->where('valid = ?', 1)->order('lastlogin DESC');
     if (isset($params['username']) && $params['username'] != "") {
         $un = strip_tags($params['username']);
         $select->where('username LIKE ?', (string) '%' . $un . '%');
     }
     if (isset($params['role']) && $params['role'] != "") {
         $r = strip_tags($params['role']);
         $select->where('role = ?', (string) $r);
     }
     if (isset($params['fullname']) && $params['fullname'] != "") {
         $fn = strip_tags($params['fullname']);
         $select->where('fullname = ?', (string) $fn);
     }
     if (isset($params['visits']) && $params['visits'] != "") {
         $v = strip_tags($params['visits']);
         $select->where('visits >= ?', (string) $v);
     }
     if (isset($params['lastlogin']) && $params['lastlogin'] != "") {
         $ll = strip_tags($params['lastlogin']);
         $select->where('lastLogin >= ?', $ll . ' 00:00:00');
     }
     $paginator = Zend_Paginator::factory($select);
     Zend_Paginator::setCache($this->_cache);
     $paginator->setItemCountPerPage(20)->setPageRange(10);
     if (isset($params['page']) && $params['page'] != "") {
         $paginator->setCurrentPageNumber($params['page']);
     }
     return $paginator;
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:36,代码来源:Users.php

示例12: getJobsAdmin

 /** Get vacancies for admin
  * @access public
  * @param integer $page
  * @return \Zend_Paginator
  */
 public function getJobsAdmin($page)
 {
     $livejobs = $this->getAdapter();
     $select = $livejobs->select()->from($this->_name)->joinLeft(array('locality' => 'staffregions'), 'locality.ID = vacancies.regionID', array('staffregions' => 'description'))->joinLeft('users', 'users.id = ' . $this->_name . '.createdBy', array('fullname'))->joinLeft('users', 'users_2.id = ' . $this->_name . '.updatedBy', array('fn' => 'fullname'))->order('id DESC');
     $data = $livejobs->fetchAll($select);
     $paginator = Zend_Paginator::factory($data);
     Zend_Paginator::setCache($this->_cache);
     $paginator->setItemCountPerPage(30)->setPageRange(10);
     if (isset($page) && $page != "") {
         $paginator->setCurrentPageNumber((int) $page);
     }
     return $paginator;
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:18,代码来源:Vacancies.php

示例13: paginatorcache

 public function paginatorcache()
 {
     $cache = $this->getResource('cachemanager')->getCache('requestcache');
     Zend_Paginator::setCache($cache);
 }
开发者ID:knatorski,项目名称:SMS,代码行数:5,代码来源:Bootstrap.php

示例14: getMintsListAllAdmin

 /** Get paginated list of mints for admin console
  * @access public
  * @param array $params
  * @return \Zend_Paginator
  */
 public function getMintsListAllAdmin($params)
 {
     $mints = $this->getAdapter();
     $select = $mints->select()->from($this->_name)->joinLeft('periods', 'periods.id = mints.period', array('t' => 'term'))->joinLeft('users', $this->_name . '.createdBy = users.id', array('fullname'))->joinLeft('users', $this->_name . '.updatedBy = users_2.id', array('fn' => 'fullname'))->where($this->_name . '.valid = ?', (int) 1);
     if (isset($params['period']) && $params['period'] != "") {
         $select->where('period = ?', (int) $params['period']);
     }
     $paginator = Zend_Paginator::factory($select);
     Zend_Paginator::setCache($this->_cache);
     $paginator->setItemCountPerPage(30)->setPageRange(10);
     if (isset($params['page']) && $params['page'] != "") {
         $paginator->setCurrentPageNumber((int) $params['page']);
     }
     return $paginator;
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:20,代码来源:Mints.php

示例15: getSmrs

 /** Get paginated gazetteer list of osdata
  * @access public
  * @param integer $page
  * @param string $county
  * @param string $district
  * @param string $parish
  * @param string $monumentName
  * @return \Zend_Paginator
  */
 public function getSmrs($page, $county, $district, $parish, $monumentName)
 {
     $acros = $this->getAdapter();
     $select = $acros->select()->from($this->_name, array('county' => 'full_county', 'gridref' => 'km_ref', 'monumentName' => 'name', 'id', 'f_code'))->where(new Zend_Db_Expr('f_code = "R" OR f_code = "A"'))->order('county');
     if (isset($monumentName) && $monumentName != "") {
         $select->where('monumentName LIKE ?', (string) '%' . $monumentName . '%');
     }
     if (isset($district) && $district != "") {
         $select->where('district = ?', (string) $district);
     }
     if (isset($county) && $county != "") {
         $select->where('county = ?', (string) $county);
     }
     if (isset($parish) && $parish != "") {
         $select->where('parish = ?', (string) $parish);
     }
     $data = $acros->fetchAll($select);
     $paginator = Zend_Paginator::factory($data);
     Zend_Paginator::setCache($this->_cache);
     $paginator->setItemCountPerPage(20)->setPageRange(10);
     if (isset($page) && $page != "") {
         $paginator->setCurrentPageNumber($page);
     }
     return $paginator;
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:34,代码来源:OsData.php


注:本文中的Zend_Paginator::setCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。