1 | <?php |
||
22 | abstract class AbstractQuery |
||
23 | { |
||
24 | /** |
||
25 | * |
||
26 | * Data to be bound to the query. |
||
27 | * |
||
28 | * @var array |
||
29 | * |
||
30 | */ |
||
31 | protected $bind_values = array(); |
||
32 | |||
33 | /** |
||
34 | * |
||
35 | * The list of WHERE conditions. |
||
36 | * |
||
37 | * @var array |
||
38 | * |
||
39 | */ |
||
40 | protected $where = array(); |
||
41 | |||
42 | /** |
||
43 | * |
||
44 | * ORDER BY these columns. |
||
45 | * |
||
46 | * @var array |
||
47 | * |
||
48 | */ |
||
49 | protected $order_by = array(); |
||
50 | |||
51 | /** |
||
52 | * |
||
53 | * The list of flags. |
||
54 | * |
||
55 | * @var array |
||
56 | * |
||
57 | */ |
||
58 | protected $flags = array(); |
||
59 | |||
60 | /** |
||
61 | * |
||
62 | * A helper for quoting identifier names. |
||
63 | * |
||
64 | * @var Quoter |
||
65 | * |
||
66 | */ |
||
67 | protected $quoter; |
||
68 | |||
69 | /** |
||
70 | * |
||
71 | * A builder for the query. |
||
72 | * |
||
73 | * @var AbstractBuilder |
||
74 | * |
||
75 | */ |
||
76 | protected $builder; |
||
77 | |||
78 | /** |
||
79 | * @var int |
||
80 | */ |
||
81 | protected $inlineCount = 0; |
||
82 | |||
83 | /** |
||
84 | * |
||
85 | * Constructor. |
||
86 | * |
||
87 | * @param Quoter $quoter A helper for quoting identifier names. |
||
88 | * |
||
89 | * @param AbstractBuilder $builder A builder for the query. |
||
90 | * |
||
91 | */ |
||
92 | 422 | public function __construct(QuoterInterface $quoter, $builder) |
|
97 | |||
98 | /** |
||
99 | * |
||
100 | * Returns this query object as an SQL statement string. |
||
101 | * |
||
102 | * @return string |
||
103 | * |
||
104 | */ |
||
105 | 248 | public function __toString() |
|
109 | |||
110 | /** |
||
111 | * |
||
112 | * Returns this query object as an SQL statement string. |
||
113 | * |
||
114 | * @return string |
||
115 | * |
||
116 | */ |
||
117 | 69 | public function getStatement() |
|
121 | |||
122 | /** |
||
123 | * |
||
124 | * Builds this query object into a string. |
||
125 | * |
||
126 | * @return string |
||
127 | * |
||
128 | */ |
||
129 | abstract protected function build(); |
||
130 | |||
131 | /** |
||
132 | * |
||
133 | * Returns the prefix to use when quoting identifier names. |
||
134 | * |
||
135 | * @return string |
||
136 | * |
||
137 | */ |
||
138 | 272 | public function getQuoteNamePrefix() |
|
142 | |||
143 | /** |
||
144 | * |
||
145 | * Returns the suffix to use when quoting identifier names. |
||
146 | * |
||
147 | * @return string |
||
148 | * |
||
149 | */ |
||
150 | 272 | public function getQuoteNameSuffix() |
|
154 | |||
155 | /** |
||
156 | * |
||
157 | * Binds multiple values to placeholders; merges with existing values. |
||
158 | * |
||
159 | * @param array $bind_values Values to bind to placeholders. |
||
160 | * |
||
161 | * @return $this |
||
162 | * |
||
163 | */ |
||
164 | 41 | public function bindValues(array $bind_values) |
|
173 | |||
174 | /** |
||
175 | * |
||
176 | * Binds a single value to the query. |
||
177 | * |
||
178 | * @param string $name The placeholder name or number. |
||
179 | * |
||
180 | * @param mixed $value The value to bind to the placeholder. |
||
181 | * |
||
182 | * @return $this |
||
183 | * |
||
184 | */ |
||
185 | 141 | public function bindValue($name, $value) |
|
190 | |||
191 | /** |
||
192 | * |
||
193 | * Gets the values to bind to placeholders. |
||
194 | * |
||
195 | * @return array |
||
196 | * |
||
197 | */ |
||
198 | 131 | public function getBindValues() |
|
202 | |||
203 | /** |
||
204 | * |
||
205 | * Reset all values bound to named placeholders. |
||
206 | * |
||
207 | * @return $this |
||
208 | * |
||
209 | */ |
||
210 | 15 | public function resetBindValues() |
|
215 | |||
216 | /** |
||
217 | * |
||
218 | * Sets or unsets specified flag. |
||
219 | * |
||
220 | * @param string $flag Flag to set or unset |
||
221 | * |
||
222 | * @param bool $enable Flag status - enabled or not (default true) |
||
223 | * |
||
224 | * @return null |
||
225 | * |
||
226 | */ |
||
227 | 43 | protected function setFlag($flag, $enable = true) |
|
235 | |||
236 | /** |
||
237 | * |
||
238 | * Returns true if the specified flag was enabled by setFlag(). |
||
239 | * |
||
240 | * @param string $flag Flag to check |
||
241 | * |
||
242 | * @return bool |
||
243 | * |
||
244 | */ |
||
245 | 10 | protected function hasFlag($flag) |
|
249 | |||
250 | /** |
||
251 | * |
||
252 | * Reset all query flags. |
||
253 | * |
||
254 | * @return $this |
||
255 | * |
||
256 | */ |
||
257 | 20 | public function resetFlags() |
|
262 | |||
263 | /** |
||
264 | * |
||
265 | * Adds conditions and binds values to a clause. |
||
266 | * |
||
267 | * @param string $clause The clause to work with, typically 'where' or |
||
268 | * 'having'. |
||
269 | * |
||
270 | * @param string $andor Add the condition using this operator, typically |
||
271 | * 'AND' or 'OR'. |
||
272 | * |
||
273 | * @param string $cond The WHERE condition. |
||
274 | * |
||
275 | * @param array $bind arguments to bind to placeholders |
||
276 | * |
||
277 | * @return null |
||
278 | * |
||
279 | */ |
||
280 | 85 | protected function addClauseCondWithBind($clause, $andor, $cond, $bind) |
|
298 | |||
299 | /** |
||
300 | * |
||
301 | * Adds to a clause through a closure, enclosing within parentheses. |
||
302 | * |
||
303 | * @param string $clause The clause to work with, typically 'where' or |
||
304 | * 'having'. |
||
305 | * |
||
306 | * @param string $andor Add the condition using this operator, typically |
||
307 | * 'AND' or 'OR'. |
||
308 | * |
||
309 | * @param callable $closure The closure that adds to the clause. |
||
310 | * |
||
311 | * @return null |
||
312 | * |
||
313 | */ |
||
314 | 10 | protected function addClauseCondClosure($clause, $andor, $closure) |
|
349 | |||
350 | /** |
||
351 | * |
||
352 | * Rebuilds a condition string, replacing sequential placeholders with |
||
353 | * named placeholders, and binding the sequential values to the named |
||
354 | * placeholders. |
||
355 | * |
||
356 | * @param string $cond The condition with sequential placeholders. |
||
357 | * |
||
358 | * @param array $bind_values The values to bind to the sequential |
||
359 | * placeholders under their named versions. |
||
360 | * |
||
361 | * @return string The rebuilt condition string. |
||
362 | * |
||
363 | */ |
||
364 | 135 | protected function rebuildCondAndBindValues($cond, array $bind_values) |
|
397 | |||
398 | 5 | protected function inlineArray(array $array) |
|
409 | |||
410 | /** |
||
411 | * |
||
412 | * Adds a column order to the query. |
||
413 | * |
||
414 | * @param array $spec The columns and direction to order by. |
||
415 | * |
||
416 | * @return $this |
||
417 | * |
||
418 | */ |
||
419 | 9 | protected function addOrderBy(array $spec) |
|
426 | } |
||
427 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..