/** * Apply page restrictions to request object (and fetch total number of objects if * auto_count is set). * OPTIMIZED FOR USING SQL_CALC_FOUND_ROWS. * * @param request RM_Store_iRequest Request * @param query RM_Db_Query Underlying query object * @return RM_Store_iRequest */ public function processRequestOpt(RM_Store_iRequest $request, RM_Db_Query $query) { if ($this->_all) { return $request; } if ($this->_autoCount) { $this->_queryStartCalc($query); } $iter = $request->limit($this->_pageSize)->offset(($this->_page - 1) * $this->_pageSize)->getIterator(); if ($this->_autoCount) { $this->_queryEndCalc($query); } return $iter; }
public function limit($limit) { $this->_request->limit($limit); return $this; }