1 | <?php |
||
13 | class WhereWriter extends AbstractBaseWriter |
||
14 | { |
||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $matchMode = [ |
||
19 | 'natural' => '(MATCH({{columnNames}}) AGAINST({{columnValues}}))', |
||
20 | 'boolean' => '(MATCH({{columnNames}}) AGAINST({{columnValues}} IN BOOLEAN MODE))', |
||
21 | 'query_expansion' => '(MATCH({{columnNames}}) AGAINST({{columnValues}} WITH QUERY EXPANSION))', |
||
22 | ]; |
||
23 | |||
24 | /** |
||
25 | * @param Where $where |
||
26 | * |
||
27 | * @return string |
||
28 | */ |
||
29 | public function writeWhere(Where $where) |
||
40 | |||
41 | /** |
||
42 | * @param Where $where |
||
43 | * |
||
44 | * @return array |
||
45 | */ |
||
46 | public function writeWhereClauses(Where $where) |
||
64 | |||
65 | /** |
||
66 | * @param Where $where |
||
67 | * @param array $whereArray |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | protected function writeWhereMatches(Where $where, array &$whereArray) |
||
91 | |||
92 | /** |
||
93 | * @param $columns |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | protected function getColumnNames($columns) |
||
106 | |||
107 | /** |
||
108 | * @param Where $where |
||
109 | * @param array $whereArray |
||
110 | * |
||
111 | * @return array |
||
112 | */ |
||
113 | protected function writeWhereIns(Where $where, array &$whereArray) |
||
120 | |||
121 | /** |
||
122 | * @param Where $where |
||
123 | * @param string $method |
||
124 | * @param string $operation |
||
125 | * |
||
126 | * @return array |
||
127 | */ |
||
128 | protected function writeWhereIn(Where $where, $method, $operation) |
||
145 | |||
146 | /** |
||
147 | * @param Where $where |
||
148 | * @param array $whereArray |
||
149 | * |
||
150 | * @return array |
||
151 | */ |
||
152 | protected function writeWhereNotIns(Where $where, array &$whereArray) |
||
159 | |||
160 | /** |
||
161 | * @param Where $where |
||
162 | * @param array $whereArray |
||
163 | * |
||
164 | * @return array |
||
165 | */ |
||
166 | protected function writeWhereBetweens(Where $where, array &$whereArray) |
||
185 | |||
186 | /** |
||
187 | * @param Where $where |
||
188 | * @param array $whereArray |
||
189 | * |
||
190 | * @return array |
||
191 | */ |
||
192 | protected function writeWhereComparisons(Where $where, array &$whereArray) |
||
213 | |||
214 | /** |
||
215 | * @param $subject |
||
216 | * |
||
217 | * @return string |
||
218 | */ |
||
219 | protected function writeWherePartialCondition(&$subject) |
||
232 | |||
233 | /** |
||
234 | * @param Where $where |
||
235 | * @param array $whereArray |
||
236 | * |
||
237 | * @return array |
||
238 | */ |
||
239 | protected function writeWhereIsNulls(Where $where, array &$whereArray) |
||
246 | |||
247 | /** |
||
248 | * @param Where $where |
||
249 | * @param string $getMethod |
||
250 | * @param string $writeMethod |
||
251 | * |
||
252 | * @return array |
||
253 | */ |
||
254 | protected function writeWhereIsNullable(Where $where, $getMethod, $writeMethod) |
||
269 | |||
270 | /** |
||
271 | * @param Where $where |
||
272 | * @param array $whereArray |
||
273 | * |
||
274 | * @return array |
||
275 | */ |
||
276 | protected function writeWhereIsNotNulls(Where $where, array &$whereArray) |
||
283 | |||
284 | /** |
||
285 | * @param Where $where |
||
286 | * @param array $whereArray |
||
287 | * |
||
288 | * @return array |
||
289 | */ |
||
290 | protected function writeWhereBooleans(Where $where, array &$whereArray) |
||
307 | |||
308 | /** |
||
309 | * @param Where $where |
||
310 | * @param array $whereArray |
||
311 | * |
||
312 | * @return array |
||
313 | */ |
||
314 | protected function writeExists(Where $where, array &$whereArray) |
||
321 | |||
322 | /** |
||
323 | * @param Where $where |
||
324 | * @param string $method |
||
325 | * @param string $operation |
||
326 | * |
||
327 | * @return array |
||
328 | */ |
||
329 | protected function writeExistence(Where $where, $method, $operation) |
||
339 | |||
340 | /** |
||
341 | * @param Where $where |
||
342 | * @param array $whereArray |
||
343 | * |
||
344 | * @return array |
||
345 | */ |
||
346 | protected function writeNotExists(Where $where, array &$whereArray) |
||
353 | |||
354 | /** |
||
355 | * @param Where $where |
||
356 | * @param array $whereArray |
||
357 | * |
||
358 | * @return array |
||
359 | */ |
||
360 | protected function writeSubWheres(Where $where, array &$whereArray) |
||
373 | } |
||
374 |