Paginator: relax requirements to Paginatable
* we need no full query interface here * introduced new interface "Paginatable" fixes #9483
This commit is contained in:
parent
593f90f330
commit
727a2d7141
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||||
|
|
||||||
|
namespace Icinga\Data;
|
||||||
|
|
||||||
|
use Countable;
|
||||||
|
|
||||||
|
interface Paginatable extends Limitable, Countable {};
|
||||||
|
|
|
@ -3,6 +3,4 @@
|
||||||
|
|
||||||
namespace Icinga\Data;
|
namespace Icinga\Data;
|
||||||
|
|
||||||
use Countable;
|
interface QueryInterface extends Fetchable, Filterable, Paginatable, Sortable {};
|
||||||
|
|
||||||
interface QueryInterface extends Fetchable, Filterable, Limitable, Sortable, Countable {};
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
namespace Icinga\Web\Widget;
|
namespace Icinga\Web\Widget;
|
||||||
|
|
||||||
use Icinga\Data\QueryInterface;
|
use Icinga\Data\Paginatable;
|
||||||
use Icinga\Exception\ProgrammingError;
|
use Icinga\Exception\ProgrammingError;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,7 +14,7 @@ class Paginator extends AbstractWidget
|
||||||
/**
|
/**
|
||||||
* The query the paginator widget is created for
|
* The query the paginator widget is created for
|
||||||
*
|
*
|
||||||
* @var QueryInterface
|
* @var Paginatable
|
||||||
*/
|
*/
|
||||||
protected $query;
|
protected $query;
|
||||||
|
|
||||||
|
@ -28,11 +28,11 @@ class Paginator extends AbstractWidget
|
||||||
/**
|
/**
|
||||||
* Set the query to create the paginator widget for
|
* Set the query to create the paginator widget for
|
||||||
*
|
*
|
||||||
* @param QueryInterface $query
|
* @param Paginatable $query
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setQuery(QueryInterface $query)
|
public function setQuery(Paginatable $query)
|
||||||
{
|
{
|
||||||
$this->query = $query;
|
$this->query = $query;
|
||||||
return $this;
|
return $this;
|
||||||
|
|
Loading…
Reference in New Issue