1 | <?php |
||
16 | class Match extends Stage |
||
17 | { |
||
18 | /** @var Expr */ |
||
19 | protected $query; |
||
20 | |||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | 60 | public function __construct(Builder $builder) |
|
30 | |||
31 | /** |
||
32 | * @see http://php.net/manual/en/language.oop5.cloning.php |
||
33 | */ |
||
34 | public function __clone() |
||
38 | |||
39 | /** |
||
40 | * Add one or more $and clauses to the current query. |
||
41 | * |
||
42 | * You can create a new expression using the {@link Builder::matchExpr()} |
||
43 | * method. |
||
44 | * |
||
45 | * @see Expr::addAnd() |
||
46 | * @see http://docs.mongodb.org/manual/reference/operator/and/ |
||
47 | * @param array|Expr $expression |
||
48 | * @param array|Expr ...$expressions |
||
49 | * @return $this |
||
50 | */ |
||
51 | 2 | public function addAnd($expression, ...$expressions) |
|
57 | |||
58 | /** |
||
59 | * Add one or more $nor clauses to the current query. |
||
60 | * |
||
61 | * You can create a new expression using the {@link Builder::matchExpr()} |
||
62 | * method. |
||
63 | * |
||
64 | * @see Expr::addNor() |
||
65 | * @see http://docs.mongodb.org/manual/reference/operator/nor/ |
||
66 | * @param array|Expr $expression |
||
67 | * @param array|Expr ...$expressions |
||
68 | * @return $this |
||
69 | */ |
||
70 | 2 | public function addNor($expression, ...$expressions) |
|
76 | |||
77 | /** |
||
78 | * Add one or more $or clauses to the current query. |
||
79 | * |
||
80 | * You can create a new expression using the {@link Builder::matchExpr()} |
||
81 | * method. |
||
82 | * |
||
83 | * @see Expr::addOr() |
||
84 | * @see http://docs.mongodb.org/manual/reference/operator/or/ |
||
85 | * @param array|Expr $expression |
||
86 | * @param array|Expr ...$expressions |
||
87 | * @return $this |
||
88 | */ |
||
89 | 3 | public function addOr($expression, ...$expressions) |
|
95 | |||
96 | /** |
||
97 | * Specify $all criteria for the current field. |
||
98 | * |
||
99 | * @see Expr::all() |
||
100 | * @see http://docs.mongodb.org/manual/reference/operator/all/ |
||
101 | * @param array $values |
||
102 | * @return $this |
||
103 | */ |
||
104 | 1 | public function all(array $values) |
|
110 | |||
111 | /** |
||
112 | * Return an array of information about the Builder state for debugging. |
||
113 | * |
||
114 | * The $name parameter may be used to return a specific key from the |
||
115 | * internal $query array property. If omitted, the entire array will be |
||
116 | * returned. |
||
117 | * |
||
118 | * @param string $name |
||
119 | * @return mixed |
||
120 | */ |
||
121 | public function debug($name = null) |
||
125 | |||
126 | /** |
||
127 | * Specify $elemMatch criteria for the current field. |
||
128 | * |
||
129 | * You can create a new expression using the {@link Builder::matchExpr()} |
||
130 | * method. |
||
131 | * |
||
132 | * @see Expr::elemMatch() |
||
133 | * @see http://docs.mongodb.org/manual/reference/operator/elemMatch/ |
||
134 | * @param array|Expr $expression |
||
135 | * @return $this |
||
136 | */ |
||
137 | public function elemMatch($expression) |
||
143 | |||
144 | /** |
||
145 | * Specify an equality match for the current field. |
||
146 | * |
||
147 | * @see Expr::equals() |
||
148 | * @param mixed $value |
||
149 | * @return $this |
||
150 | */ |
||
151 | 11 | public function equals($value) |
|
157 | |||
158 | /** |
||
159 | * Specify $exists criteria for the current field. |
||
160 | * |
||
161 | * @see Expr::exists() |
||
162 | * @see http://docs.mongodb.org/manual/reference/operator/exists/ |
||
163 | * @param bool $bool |
||
164 | * @return $this |
||
165 | */ |
||
166 | 2 | public function exists($bool) |
|
172 | |||
173 | /** |
||
174 | * Create a new Expr instance that can be used to build partial expressions |
||
175 | * for other operator methods. |
||
176 | * |
||
177 | * @return Expr $expr |
||
178 | */ |
||
179 | 60 | public function expr() |
|
183 | |||
184 | /** |
||
185 | * Set the current field for building the expression. |
||
186 | * |
||
187 | * @see Expr::field() |
||
188 | * @param string $field |
||
189 | * @return $this |
||
190 | */ |
||
191 | 13 | public function field($field) |
|
197 | |||
198 | /** |
||
199 | * Add $geoIntersects criteria with a GeoJSON geometry to the query. |
||
200 | * |
||
201 | * The geometry parameter GeoJSON object or an array corresponding to the |
||
202 | * geometry's JSON representation. |
||
203 | * |
||
204 | * @see Expr::geoIntersects() |
||
205 | * @see http://docs.mongodb.org/manual/reference/operator/geoIntersects/ |
||
206 | * @param array|Geometry $geometry |
||
207 | * @return $this |
||
208 | */ |
||
209 | 1 | public function geoIntersects($geometry) |
|
215 | |||
216 | /** |
||
217 | * Add $geoWithin criteria with a GeoJSON geometry to the query. |
||
218 | * |
||
219 | * The geometry parameter GeoJSON object or an array corresponding to the |
||
220 | * geometry's JSON representation. |
||
221 | * |
||
222 | * @see Expr::geoWithin() |
||
223 | * @see http://docs.mongodb.org/manual/reference/operator/geoWithin/ |
||
224 | * @return $this |
||
225 | */ |
||
226 | 1 | public function geoWithin(Geometry $geometry) |
|
232 | |||
233 | /** |
||
234 | * Add $geoWithin criteria with a $box shape to the query. |
||
235 | * |
||
236 | * A rectangular polygon will be constructed from a pair of coordinates |
||
237 | * corresponding to the bottom left and top right corners. |
||
238 | * |
||
239 | * Note: the $box operator only supports legacy coordinate pairs and 2d |
||
240 | * indexes. This cannot be used with 2dsphere indexes and GeoJSON shapes. |
||
241 | * |
||
242 | * @see Expr::geoWithinBox() |
||
243 | * @see http://docs.mongodb.org/manual/reference/operator/box/ |
||
244 | * @param float $x1 |
||
245 | * @param float $y1 |
||
246 | * @param float $x2 |
||
247 | * @param float $y2 |
||
248 | * @return $this |
||
249 | */ |
||
250 | 1 | public function geoWithinBox($x1, $y1, $x2, $y2) |
|
256 | |||
257 | /** |
||
258 | * Add $geoWithin criteria with a $center shape to the query. |
||
259 | * |
||
260 | * Note: the $center operator only supports legacy coordinate pairs and 2d |
||
261 | * indexes. This cannot be used with 2dsphere indexes and GeoJSON shapes. |
||
262 | * |
||
263 | * @see Expr::geoWithinCenter() |
||
264 | * @see http://docs.mongodb.org/manual/reference/operator/center/ |
||
265 | * @param float $x |
||
266 | * @param float $y |
||
267 | * @param float $radius |
||
268 | * @return $this |
||
269 | */ |
||
270 | 1 | public function geoWithinCenter($x, $y, $radius) |
|
276 | |||
277 | /** |
||
278 | * Add $geoWithin criteria with a $centerSphere shape to the query. |
||
279 | * |
||
280 | * Note: the $centerSphere operator supports both 2d and 2dsphere indexes. |
||
281 | * |
||
282 | * @see Expr::geoWithinCenterSphere() |
||
283 | * @see http://docs.mongodb.org/manual/reference/operator/centerSphere/ |
||
284 | * @param float $x |
||
285 | * @param float $y |
||
286 | * @param float $radius |
||
287 | * @return $this |
||
288 | */ |
||
289 | 1 | public function geoWithinCenterSphere($x, $y, $radius) |
|
295 | |||
296 | /** |
||
297 | * Add $geoWithin criteria with a $polygon shape to the query. |
||
298 | * |
||
299 | * Point coordinates are in x, y order (easting, northing for projected |
||
300 | * coordinates, longitude, latitude for geographic coordinates). |
||
301 | * |
||
302 | * The last point coordinate is implicitly connected with the first. |
||
303 | * |
||
304 | * Note: the $polygon operator only supports legacy coordinate pairs and 2d |
||
305 | * indexes. This cannot be used with 2dsphere indexes and GeoJSON shapes. |
||
306 | * |
||
307 | * @see Expr::geoWithinPolygon() |
||
308 | * @see http://docs.mongodb.org/manual/reference/operator/polygon/ |
||
309 | * @param array $point1 First point of the polygon |
||
310 | * @param array $point2 Second point of the polygon |
||
311 | * @param array $point3 Third point of the polygon |
||
312 | * @param array ...$points Additional points of the polygon |
||
313 | * @return $this |
||
314 | */ |
||
315 | 1 | public function geoWithinPolygon($point1, $point2, $point3, ...$points) |
|
321 | |||
322 | /** |
||
323 | * {@inheritdoc} |
||
324 | */ |
||
325 | 9 | public function getExpression() |
|
331 | |||
332 | /** |
||
333 | * Specify $gt criteria for the current field. |
||
334 | * |
||
335 | * @see Expr::gt() |
||
336 | * @see http://docs.mongodb.org/manual/reference/operator/gt/ |
||
337 | * @param mixed $value |
||
338 | * @return $this |
||
339 | */ |
||
340 | 2 | public function gt($value) |
|
346 | |||
347 | /** |
||
348 | * Specify $gte criteria for the current field. |
||
349 | * |
||
350 | * @see Expr::gte() |
||
351 | * @see http://docs.mongodb.org/manual/reference/operator/gte/ |
||
352 | * @param mixed $value |
||
353 | * @return $this |
||
354 | */ |
||
355 | 2 | public function gte($value) |
|
361 | |||
362 | /** |
||
363 | * Specify $in criteria for the current field. |
||
364 | * |
||
365 | * @see Expr::in() |
||
366 | * @see http://docs.mongodb.org/manual/reference/operator/in/ |
||
367 | * @param array $values |
||
368 | * @return $this |
||
369 | */ |
||
370 | 2 | public function in(array $values) |
|
376 | |||
377 | /** |
||
378 | * @param object $document |
||
379 | * @return $this |
||
380 | */ |
||
381 | public function includesReferenceTo($document) |
||
387 | |||
388 | /** |
||
389 | * Set the $language option for $text criteria. |
||
390 | * |
||
391 | * This method must be called after text(). |
||
392 | * |
||
393 | * @see Expr::language() |
||
394 | * @see http://docs.mongodb.org/manual/reference/operator/text/ |
||
395 | * @param string $language |
||
396 | * @return $this |
||
397 | */ |
||
398 | 1 | public function language($language) |
|
404 | |||
405 | /** |
||
406 | * Specify $lt criteria for the current field. |
||
407 | * |
||
408 | * @see Expr::lte() |
||
409 | * @see http://docs.mongodb.org/manual/reference/operator/lte/ |
||
410 | * @param mixed $value |
||
411 | * @return $this |
||
412 | */ |
||
413 | public function lt($value) |
||
419 | |||
420 | /** |
||
421 | * Specify $lte criteria for the current field. |
||
422 | * |
||
423 | * @see Expr::lte() |
||
424 | * @see http://docs.mongodb.org/manual/reference/operator/lte/ |
||
425 | * @param mixed $value |
||
426 | * @return $this |
||
427 | */ |
||
428 | 1 | public function lte($value) |
|
434 | |||
435 | /** |
||
436 | * Add $maxDistance criteria to the query. |
||
437 | * |
||
438 | * If the query uses GeoJSON points, $maxDistance will be interpreted in |
||
439 | * meters. If legacy point coordinates are used, $maxDistance will be |
||
440 | * interpreted in radians. |
||
441 | * |
||
442 | * @see Expr::maxDistance() |
||
443 | * @see http://docs.mongodb.org/manual/reference/command/geoNear/ |
||
444 | * @see http://docs.mongodb.org/manual/reference/operator/maxDistance/ |
||
445 | * @see http://docs.mongodb.org/manual/reference/operator/near/ |
||
446 | * @see http://docs.mongodb.org/manual/reference/operator/nearSphere/ |
||
447 | * @param float $maxDistance |
||
448 | * @return $this |
||
449 | */ |
||
450 | public function maxDistance($maxDistance) |
||
456 | |||
457 | /** |
||
458 | * Add $minDistance criteria to the query. |
||
459 | * |
||
460 | * If the query uses GeoJSON points, $minDistance will be interpreted in |
||
461 | * meters. If legacy point coordinates are used, $minDistance will be |
||
462 | * interpreted in radians. |
||
463 | * |
||
464 | * @see Expr::minDistance() |
||
465 | * @see http://docs.mongodb.org/manual/reference/command/geoNear/ |
||
466 | * @see http://docs.mongodb.org/manual/reference/operator/minDistance/ |
||
467 | * @see http://docs.mongodb.org/manual/reference/operator/near/ |
||
468 | * @see http://docs.mongodb.org/manual/reference/operator/nearSphere/ |
||
469 | * @param float $minDistance |
||
470 | * @return $this |
||
471 | */ |
||
472 | public function minDistance($minDistance) |
||
478 | |||
479 | /** |
||
480 | * Specify $mod criteria for the current field. |
||
481 | * |
||
482 | * @see Expr::mod() |
||
483 | * @see http://docs.mongodb.org/manual/reference/operator/mod/ |
||
484 | * @param float|int $divisor |
||
485 | * @param float|int $remainder |
||
486 | * @return $this |
||
487 | */ |
||
488 | 1 | public function mod($divisor, $remainder = 0) |
|
494 | |||
495 | /** |
||
496 | * Negates an expression for the current field. |
||
497 | * |
||
498 | * You can create a new expression using the {@link Builder::matchExpr()} |
||
499 | * method. |
||
500 | * |
||
501 | * @see Expr::not() |
||
502 | * @see http://docs.mongodb.org/manual/reference/operator/not/ |
||
503 | * @param array|Expr $expression |
||
504 | * @return $this |
||
505 | */ |
||
506 | 1 | public function not($expression) |
|
512 | |||
513 | /** |
||
514 | * Specify $ne criteria for the current field. |
||
515 | * |
||
516 | * @see Expr::notEqual() |
||
517 | * @see http://docs.mongodb.org/manual/reference/operator/ne/ |
||
518 | * @param mixed $value |
||
519 | * @return $this |
||
520 | */ |
||
521 | 2 | public function notEqual($value) |
|
527 | |||
528 | /** |
||
529 | * Specify $nin criteria for the current field. |
||
530 | * |
||
531 | * @see Expr::notIn() |
||
532 | * @see http://docs.mongodb.org/manual/reference/operator/nin/ |
||
533 | * @param array $values |
||
534 | * @return $this |
||
535 | */ |
||
536 | 1 | public function notIn(array $values) |
|
542 | |||
543 | /** |
||
544 | * Specify $gte and $lt criteria for the current field. |
||
545 | * |
||
546 | * This method is shorthand for specifying $gte criteria on the lower bound |
||
547 | * and $lt criteria on the upper bound. The upper bound is not inclusive. |
||
548 | * |
||
549 | * @see Expr::range() |
||
550 | * @param mixed $start |
||
551 | * @param mixed $end |
||
552 | * @return $this |
||
553 | */ |
||
554 | 1 | public function range($start, $end) |
|
560 | |||
561 | /** |
||
562 | * @param object $document |
||
563 | * @return $this |
||
564 | */ |
||
565 | public function references($document) |
||
571 | |||
572 | /** |
||
573 | * Specify $size criteria for the current field. |
||
574 | * |
||
575 | * @see Expr::size() |
||
576 | * @see http://docs.mongodb.org/manual/reference/operator/size/ |
||
577 | * @param int $size |
||
578 | * @return $this |
||
579 | */ |
||
580 | 1 | public function size($size) |
|
586 | |||
587 | /** |
||
588 | * Specify $text criteria for the current field. |
||
589 | * |
||
590 | * The $language option may be set with {@link Builder::language()}. |
||
591 | * |
||
592 | * You can only use this in the first $match stage of a pipeline. |
||
593 | * |
||
594 | * @see Expr::text() |
||
595 | * @see http://docs.mongodb.org/master/reference/operator/query/text/ |
||
596 | * @param string $search |
||
597 | * @return $this |
||
598 | */ |
||
599 | 1 | public function text($search) |
|
605 | |||
606 | /** |
||
607 | * Specify $type criteria for the current field. |
||
608 | * |
||
609 | * @see Expr::type() |
||
610 | * @see http://docs.mongodb.org/manual/reference/operator/type/ |
||
611 | * @param int $type |
||
612 | * @return $this |
||
613 | */ |
||
614 | 1 | public function type($type) |
|
620 | } |
||
621 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.