Fixed method getNextPage that was always returning the last page in all branches
This commit is contained in:
parent
6ed10e06ed
commit
85e26cfd7b
@ -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());
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user