/** * Applies paging on data grid. * @return void */ protected function applyPaging() { $this->paginator->page = $this->page; $this->paginator->itemCount = count($this->dataSource); if ($this->wasRendered && $this->paginator->itemCount < 1 && !empty($this->filters)) { // NOTE: don't use flash messages (because you can't - header already sent) $this->getTemplate()->flashes[] = (object) array('message' => $this->translate("Used filters did not match any items."), 'type' => 'info'); } $this->dataSource->applyLimit($this->paginator->length, $this->paginator->offset); }
/** * Limits number of rows. * @param int limit * @param int offset * @return Database provides a fluent interface */ public function applyLimit($limit, $offset = NULL) { parent::applyLimit($limit, $offset); $this->array = NULL; return $this; }