diff --git a/library/Icinga/Data/Fetchable.php b/library/Icinga/Data/Fetchable.php index 2164bb1b2..0992be933 100644 --- a/library/Icinga/Data/Fetchable.php +++ b/library/Icinga/Data/Fetchable.php @@ -3,20 +3,11 @@ namespace Icinga\Data; -use Iterator; - /** * Interface for retrieving data */ interface Fetchable { - /** - * Fetch and return all rows of the result set using an iterator - * - * @return Iterator - */ - public function fetch(); - /** * Retrieve an array containing all rows of the result set * diff --git a/library/Icinga/Data/SimpleQuery.php b/library/Icinga/Data/SimpleQuery.php index ebcaa61a2..8da712598 100644 --- a/library/Icinga/Data/SimpleQuery.php +++ b/library/Icinga/Data/SimpleQuery.php @@ -4,7 +4,6 @@ namespace Icinga\Data; use ArrayIterator; -use Iterator; use IteratorAggregate; use Icinga\Data\Filter\Filter; use Icinga\Exception\IcingaException; @@ -104,11 +103,11 @@ class SimpleQuery implements QueryInterface, Queryable, IteratorAggregate /** * Return a iterable for this query's result * - * @return Iterator + * @return ArrayIterator */ public function getIterator() { - return $this->fetch(); + return new ArrayIterator($this->fetchAll()); } /** @@ -352,16 +351,6 @@ class SimpleQuery implements QueryInterface, Queryable, IteratorAggregate return $this->limitOffset; } - /** - * Fetch and return all rows of the result set using an iterator - * - * @return ArrayIterator - */ - public function fetch() - { - return new ArrayIterator($this->fetchAll()); - } - /** * Retrieve an array containing all rows of the result set * diff --git a/modules/monitoring/library/Monitoring/DataView/DataView.php b/modules/monitoring/library/Monitoring/DataView/DataView.php index dfbdd8a14..6bed36fe1 100644 --- a/modules/monitoring/library/Monitoring/DataView/DataView.php +++ b/modules/monitoring/library/Monitoring/DataView/DataView.php @@ -3,7 +3,7 @@ namespace Icinga\Module\Monitoring\DataView; -use Iterator; +use ArrayIterator; use IteratorAggregate; use Icinga\Data\QueryInterface; use Icinga\Data\Filter\Filter; @@ -61,11 +61,11 @@ abstract class DataView implements QueryInterface, IteratorAggregate /** * Return a iterator for all rows of the result set * - * @return Iterator + * @return ArrayIterator */ public function getIterator() { - return $this->fetch(); + return new ArrayIterator($this->fetchAll()); } /** @@ -469,16 +469,6 @@ abstract class DataView implements QueryInterface, IteratorAggregate return $this->query->hasOffset(); } - /** - * Fetch and return all rows of the result set using an iterator - * - * @return Iterator - */ - public function fetch() - { - return $this->getQuery()->fetch(); - } - /** * Retrieve an array containing all rows of the result set *