parent
d39c697d0e
commit
3f25cf560e
|
@ -78,8 +78,8 @@ class GroupController extends Controller
|
||||||
$this->setupFilterControl($filterEditor);
|
$this->setupFilterControl($filterEditor);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->view->groups = $query->paginate();
|
$this->setupPaginationControl($query);
|
||||||
$this->setupPaginationControl($this->view->groups);
|
$this->view->groups = $query;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Notification::error($e->getMessage());
|
Notification::error($e->getMessage());
|
||||||
Logger::error($e);
|
Logger::error($e);
|
||||||
|
|
|
@ -78,8 +78,8 @@ class UserController extends Controller
|
||||||
$this->setupFilterControl($filterEditor);
|
$this->setupFilterControl($filterEditor);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->view->users = $query->paginate();
|
$this->setupPaginationControl($query);
|
||||||
$this->setupPaginationControl($this->view->users);
|
$this->view->users = $query;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Notification::error($e->getMessage());
|
Notification::error($e->getMessage());
|
||||||
Logger::error($e);
|
Logger::error($e);
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
namespace Icinga\Repository;
|
namespace Icinga\Repository;
|
||||||
|
|
||||||
use Zend_Paginator;
|
|
||||||
use Icinga\Application\Logger;
|
use Icinga\Application\Logger;
|
||||||
use Icinga\Data\QueryInterface;
|
use Icinga\Data\QueryInterface;
|
||||||
use Icinga\Data\Filter\Filter;
|
use Icinga\Data\Filter\Filter;
|
||||||
|
@ -364,23 +363,6 @@ class RepositoryQuery implements QueryInterface
|
||||||
return $this->query->getOffset();
|
return $this->query->getOffset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return a paginator object for this query
|
|
||||||
*
|
|
||||||
* If not given, $itemsPerPage and $pageNumber will be set to their URL parameter counterparts.
|
|
||||||
*
|
|
||||||
* @param int $itemsPerPage Number of items per page
|
|
||||||
* @param int $pageNumber Current page number
|
|
||||||
*
|
|
||||||
* @return Zend_Paginator
|
|
||||||
*/
|
|
||||||
public function paginate($itemsPerPage = null, $pageNumber = null)
|
|
||||||
{
|
|
||||||
$paginator = $this->query->paginate($itemsPerPage, $pageNumber);
|
|
||||||
$paginator->getAdapter()->setQuery($this);
|
|
||||||
return $paginator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch and return the first column of this query's first row
|
* Fetch and return the first column of this query's first row
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue