public function getPageCount() { if ($this->_customPaging) { if ($this->_virtualCount >= 0) { return (int) (($this->_virtualCount + $this->_pageSize - 1) / $this->_pageSize); } else { return -1; } } else { return (int) ((parent::getCount() + $this->_pageSize - 1) / $this->_pageSize); } }