Fixed _adjustOffset in order to get it working after previous change in Pager
This commit is contained in:
parent
78edfd59a6
commit
99d026b894
@ -107,9 +107,9 @@ class Doctrine_Pager
|
||||
{
|
||||
// retrieve the number of items found
|
||||
$count = $this->getCountQuery()->count($this->getCountQueryParams($params));
|
||||
$this->_setNumResults($count);
|
||||
|
||||
$this->_setExecuted(true);
|
||||
$this->_setNumResults($count);
|
||||
$this->_setExecuted(true); // _adjustOffset relies of _executed equals true = getNumResults()
|
||||
|
||||
$this->_adjustOffset();
|
||||
}
|
||||
@ -124,7 +124,6 @@ class Doctrine_Pager
|
||||
*/
|
||||
protected function _adjustOffset()
|
||||
{
|
||||
if (!$this->getExecuted()) {
|
||||
// Define new total of pages
|
||||
$this->_setLastPage(
|
||||
max(1, ceil($this->getNumResults() / $this->getMaxPerPage()))
|
||||
@ -136,7 +135,6 @@ class Doctrine_Pager
|
||||
$p->offset($offset);
|
||||
$p->limit($this->getMaxPerPage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user