Exemple #1
0
 /**
  * @see http://php.net/manual/en/class.iterator.php#96691
  * @return void
  */
 public function next()
 {
     $this->_counter++;
     if (!isset($this->_resultSet[$this->_counter])) {
         $this->_resultSet = $this->_query->offset($this->_queryOffset)->limit($this->_limit)->all()->toArray();
         $this->_queryOffset += $this->_limit;
         $this->_counter = 0;
     }
 }
Exemple #2
0
 /**
  * Prepare CakePHP paging
  *
  * @param Request $request DataTable request
  */
 protected function preparePaging(Request $request)
 {
     self::$countBeforePaging = $this->query->count();
     $this->query->limit($request->getLength());
     $this->query->offset($request->getStart());
 }