1
0
mirror of synced 2025-01-19 06:51:40 +03:00

Fixed method getNextPage that was always returning the last page in all branches

This commit is contained in:
guilhermeblanco 2008-02-21 04:15:13 +00:00
parent 6ed10e06ed
commit 85e26cfd7b

View File

@ -270,12 +270,12 @@ class Doctrine_Pager
public function getNextPage() public function getNextPage()
{ {
if ($this->getExecuted()) { if ($this->getExecuted()) {
return $this->_lastPage; return min($this->getPage() + 1, $this->getLastPage());
} }
throw new Doctrine_Pager_Exception( throw new Doctrine_Pager_Exception(
'Cannot retrieve the last page number of a not yet executed Pager query' 'Cannot retrieve the last page number of a not yet executed Pager query'
);return min($this->getPage() + 1, $this->getLastPage()); );
} }