mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-06-29 10:04:24 +02:00
monitoring: Add `DataView::count()'
This commit is contained in:
parent
264d818133
commit
2dd81d12ba
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Module\Monitoring\DataView;
|
namespace Icinga\Module\Monitoring\DataView;
|
||||||
|
|
||||||
|
use Countable;
|
||||||
use Icinga\Data\Filter\Filter;
|
use Icinga\Data\Filter\Filter;
|
||||||
use Icinga\Data\SimpleQuery;
|
use Icinga\Data\SimpleQuery;
|
||||||
use Icinga\Data\Browsable;
|
use Icinga\Data\Browsable;
|
||||||
@ -18,7 +19,7 @@ use Icinga\Module\Monitoring\Backend;
|
|||||||
/**
|
/**
|
||||||
* A read-only view of an underlying query
|
* A read-only view of an underlying query
|
||||||
*/
|
*/
|
||||||
abstract class DataView implements Browsable, Filterable, Sortable
|
abstract class DataView implements Browsable, Countable, Filterable, Sortable
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The query used to populate the view
|
* The query used to populate the view
|
||||||
@ -328,4 +329,14 @@ public function dump()
|
|||||||
{
|
{
|
||||||
return $this->query->paginate($itemsPerPage, $pageNumber);
|
return $this->query->paginate($itemsPerPage, $pageNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Count result set
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function count()
|
||||||
|
{
|
||||||
|
return count($this->query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user