示例#1
0
 /**
  * Applies the pagination to the model query of this table
  * @return null
  */
 protected function applyPagination()
 {
     if (!$this->pageRows) {
         return;
     }
     $this->countRows = $this->countTotalRows();
     $this->pages = ceil($this->countRows / $this->pageRows);
     if ($this->page > $this->pages) {
         $this->page = 1;
     }
     $offset = ($this->page - 1) * $this->pageRows;
     $this->query->setLimit($this->pageRows, $offset);
 }