1: <?php
2:
3: namespace PHPixie\ORM\Steps\Step\Query\Result;
4:
5: class Iterator extends \PHPixie\ORM\Steps\Step\Query\Result
6: {
7: protected $iteratorUsed = false;
8:
9: public function getIterator()
10: {
11: if($this->iteratorUsed) {
12: throw new \PHPixie\ORM\Exception\Plan("This iterator has already been used");
13: }
14:
15: $this->iteratorUsed = true;
16: return $this->result();
17: }
18:
19: public function asArray()
20: {
21: return $this->getIterator()->asArray();
22: }
23: }
24: