1 | <?php |
||
27 | class QuerySource extends AbstractSource implements QueryableSourceInterface |
||
28 | { |
||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $query; |
||
33 | |||
34 | /** |
||
35 | * @var AdapterInterface |
||
36 | */ |
||
37 | protected $adapter; |
||
38 | |||
39 | /** |
||
40 | * Initial params received in the constructor. |
||
41 | * |
||
42 | * @var ArrayObject |
||
43 | */ |
||
44 | protected $params; |
||
45 | |||
46 | /** |
||
47 | * The query string contains the query as it has been crafted (with options, limits...). |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $query_string; |
||
52 | |||
53 | /** |
||
54 | * @var ColumnModel |
||
55 | */ |
||
56 | protected $columnModel; |
||
57 | |||
58 | /** |
||
59 | * @param AdapterInterface $adapter |
||
60 | * @param string $query |
||
61 | */ |
||
62 | 10 | public function __construct(AdapterInterface $adapter, $query = null) |
|
70 | |||
71 | /** |
||
72 | * @param string $query |
||
73 | */ |
||
74 | 10 | public function setQuery($query) |
|
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getQuery() |
||
86 | |||
87 | /** |
||
88 | * @param string $query |
||
89 | * @param Options $options |
||
90 | * |
||
91 | * @return string query |
||
92 | */ |
||
93 | 6 | protected function assignOptions($query, Options $options) |
|
126 | |||
127 | /** |
||
128 | * @param Options $options |
||
129 | * |
||
130 | * @throws Exception\EmptyQueryException |
||
131 | * @throws Exception\ErrorException |
||
132 | * |
||
133 | * @return ResultSet |
||
134 | */ |
||
135 | 6 | public function getData(Options $options = null) |
|
163 | |||
164 | 2 | public function loadDefaultColumnModel() |
|
169 | |||
170 | /** |
||
171 | * {@inheritdoc} |
||
172 | * |
||
173 | * @throws Exception\UnsupportedFeatureException |
||
174 | */ |
||
175 | 4 | public function getMetadataReader() |
|
183 | |||
184 | /** |
||
185 | * @throws Exception\UnsupportedFeatureException |
||
186 | */ |
||
187 | 4 | protected function getDefaultMetadataReader() |
|
200 | |||
201 | /** |
||
202 | * Return the query string that was executed with options etc. |
||
203 | * |
||
204 | * @throws Exception\InvalidUsageException |
||
205 | * |
||
206 | * @return string |
||
207 | */ |
||
208 | 2 | public function getQueryString() |
|
216 | |||
217 | /** |
||
218 | * Return the query string. |
||
219 | * |
||
220 | * @throws Exception\InvalidUsageException |
||
221 | * |
||
222 | * @return string |
||
223 | */ |
||
224 | public function __toString() |
||
232 | } |
||
233 |