mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-21 12:54:26 +02:00
DataView: Implement interface IteratorAggregate
I'd like to foreach such.
This commit is contained in:
parent
ed5f646b6f
commit
5faebb4a88
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
namespace Icinga\Module\Monitoring\DataView;
|
namespace Icinga\Module\Monitoring\DataView;
|
||||||
|
|
||||||
|
use ArrayIterator;
|
||||||
|
use IteratorAggregate;
|
||||||
use Icinga\Data\QueryInterface;
|
use Icinga\Data\QueryInterface;
|
||||||
use Icinga\Data\Filter\Filter;
|
use Icinga\Data\Filter\Filter;
|
||||||
use Icinga\Data\Filter\FilterMatch;
|
use Icinga\Data\Filter\FilterMatch;
|
||||||
@ -56,6 +58,16 @@ abstract class DataView implements QueryInterface, IteratorAggregate
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a iterator for all rows of the result set
|
||||||
|
*
|
||||||
|
* @return ArrayIterator
|
||||||
|
*/
|
||||||
|
public function getIterator()
|
||||||
|
{
|
||||||
|
return new ArrayIterator($this->fetchAll());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the query name this data view relies on
|
* Get the query name this data view relies on
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user