Commit 99d026b8 authored by guilhermeblanco's avatar guilhermeblanco

Fixed _adjustOffset in order to get it working after previous change in Pager

parent 78edfd59
......@@ -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());
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment