1 | <?php |
||
15 | abstract class AbstractQuery implements IteratorAggregate |
||
16 | { |
||
17 | private $dataSource; |
||
18 | /** |
||
19 | * @var OperationInterface[] |
||
20 | */ |
||
21 | private $operations; |
||
22 | |||
23 | private $dynamicFields; |
||
24 | |||
25 | /** |
||
26 | * @return AbstractFactory |
||
27 | */ |
||
28 | abstract protected function getHandlerFactory(); |
||
29 | |||
30 | /** |
||
31 | * AbstractQuery constructor. |
||
32 | * @param $dataSource |
||
33 | * @param string $rowClass |
||
34 | */ |
||
35 | 11 | public function __construct($dataSource, $rowClass) |
|
42 | |||
43 | 7 | public function getIterator() |
|
52 | |||
53 | 5 | protected function initialize() |
|
57 | |||
58 | 10 | protected function execute($data) |
|
65 | |||
66 | /** |
||
67 | * @return HandlerInterface[] |
||
68 | */ |
||
69 | 10 | protected function getHandlers() |
|
86 | |||
87 | /** |
||
88 | * @return RowInterface[]|\Traversable |
||
89 | */ |
||
90 | 10 | public function get() |
|
94 | |||
95 | /** |
||
96 | * @return RowInterface[] |
||
97 | */ |
||
98 | 8 | public function getArray() |
|
103 | |||
104 | /** |
||
105 | * @return array |
||
106 | */ |
||
107 | public function getRaw() |
||
116 | |||
117 | /** |
||
118 | * @param OperationInterface $operation |
||
119 | * @return $this |
||
120 | */ |
||
121 | 10 | public function addOperation(OperationInterface $operation) |
|
126 | |||
127 | 7 | public function addOperations(array $operations) |
|
134 | |||
135 | 2 | public function hasOperation(OperationInterface $operation) |
|
139 | |||
140 | 2 | public function removeOperation(OperationInterface $operation) |
|
150 | |||
151 | public function getSrc() |
||
155 | } |
||
156 |