1: <?php
2:
3: namespace PHPixie\ORM\Steps\Step\Query;
4:
5: class Count extends \PHPixie\ORM\Steps\Step\Query
6: {
7: protected $count;
8:
9: public function execute()
10: {
11: $this->count = $this->query->execute();
12:
13: if ($this->count === null)
14: throw new \PHPixie\ORM\Exception\Plan("Query did not return a result.");
15: }
16:
17: public function count()
18: {
19: if ($this->count === null)
20: throw new \PHPixie\ORM\Exception\Plan("This plan step has not been executed yet.");
21:
22: return $this->count;
23: }
24:
25: }
26: