FileReader: Mimic cursor capability
This commit is contained in:
parent
ae30a62055
commit
5d50eabb44
|
@ -4,6 +4,7 @@
|
|||
namespace Icinga\Protocol\File;
|
||||
|
||||
use Countable;
|
||||
use ArrayIterator;
|
||||
use Icinga\Data\Selectable;
|
||||
use Icinga\Data\ConfigObject;
|
||||
|
||||
|
@ -71,6 +72,18 @@ class FileReader implements Selectable, Countable
|
|||
return new FileQuery($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch and return all rows of the given query's result set using an iterator
|
||||
*
|
||||
* @param FileQuery $query
|
||||
*
|
||||
* @return ArrayIterator
|
||||
*/
|
||||
public function query(FileQuery $query)
|
||||
{
|
||||
return new ArrayIterator($this->fetchAll($query));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of available valid lines.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue