1 | <?php |
||
30 | class Match extends Stage |
||
31 | { |
||
32 | /** |
||
33 | * @var Expr |
||
34 | */ |
||
35 | protected $query; |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | 60 | public function __construct(Builder $builder) |
|
46 | |||
47 | /** |
||
48 | * @see http://php.net/manual/en/language.oop5.cloning.php |
||
49 | */ |
||
50 | public function __clone() |
||
54 | |||
55 | /** |
||
56 | * Add one or more $and clauses to the current query. |
||
57 | * |
||
58 | * You can create a new expression using the {@link Builder::matchExpr()} |
||
59 | * method. |
||
60 | * |
||
61 | * @see Expr::addAnd() |
||
62 | * @see http://docs.mongodb.org/manual/reference/operator/and/ |
||
63 | * @param array|Expr $expression |
||
64 | * @return $this |
||
65 | */ |
||
66 | 2 | public function addAnd($expression /* , $expression2, ... */) |
|
72 | |||
73 | /** |
||
74 | * Add one or more $nor clauses to the current query. |
||
75 | * |
||
76 | * You can create a new expression using the {@link Builder::matchExpr()} |
||
77 | * method. |
||
78 | * |
||
79 | * @see Expr::addNor() |
||
80 | * @see http://docs.mongodb.org/manual/reference/operator/nor/ |
||
81 | * @param array|Expr $expression |
||
82 | * @return $this |
||
83 | */ |
||
84 | 2 | public function addNor($expression /*, $expression2, ... */) |
|
90 | |||
91 | /** |
||
92 | * Add one or more $or clauses to the current query. |
||
93 | * |
||
94 | * You can create a new expression using the {@link Builder::matchExpr()} |
||
95 | * method. |
||
96 | * |
||
97 | * @see Expr::addOr() |
||
98 | * @see http://docs.mongodb.org/manual/reference/operator/or/ |
||
99 | * @param array|Expr $expression |
||
100 | * @return $this |
||
101 | */ |
||
102 | 3 | public function addOr($expression /* , $expression2, ... */) |
|
108 | |||
109 | /** |
||
110 | * Specify $all criteria for the current field. |
||
111 | * |
||
112 | * @see Expr::all() |
||
113 | * @see http://docs.mongodb.org/manual/reference/operator/all/ |
||
114 | * @param array $values |
||
115 | * @return $this |
||
116 | */ |
||
117 | 1 | public function all(array $values) |
|
123 | |||
124 | /** |
||
125 | * Return an array of information about the Builder state for debugging. |
||
126 | * |
||
127 | * The $name parameter may be used to return a specific key from the |
||
128 | * internal $query array property. If omitted, the entire array will be |
||
129 | * returned. |
||
130 | * |
||
131 | * @param string $name |
||
132 | * @return mixed |
||
133 | */ |
||
134 | public function debug($name = null) |
||
138 | |||
139 | /** |
||
140 | * Specify $elemMatch criteria for the current field. |
||
141 | * |
||
142 | * You can create a new expression using the {@link Builder::matchExpr()} |
||
143 | * method. |
||
144 | * |
||
145 | * @see Expr::elemMatch() |
||
146 | * @see http://docs.mongodb.org/manual/reference/operator/elemMatch/ |
||
147 | * @param array|Expr $expression |
||
148 | * @return $this |
||
149 | */ |
||
150 | public function elemMatch($expression) |
||
156 | |||
157 | /** |
||
158 | * Specify an equality match for the current field. |
||
159 | * |
||
160 | * @see Expr::equals() |
||
161 | * @param mixed $value |
||
162 | * @return $this |
||
163 | */ |
||
164 | 11 | public function equals($value) |
|
170 | |||
171 | /** |
||
172 | * Specify $exists criteria for the current field. |
||
173 | * |
||
174 | * @see Expr::exists() |
||
175 | * @see http://docs.mongodb.org/manual/reference/operator/exists/ |
||
176 | * @param boolean $bool |
||
177 | * @return $this |
||
178 | */ |
||
179 | 2 | public function exists($bool) |
|
185 | |||
186 | /** |
||
187 | * Create a new Expr instance that can be used to build partial expressions |
||
188 | * for other operator methods. |
||
189 | * |
||
190 | * @return Expr $expr |
||
191 | */ |
||
192 | 60 | public function expr() |
|
196 | |||
197 | /** |
||
198 | * Set the current field for building the expression. |
||
199 | * |
||
200 | * @see Expr::field() |
||
201 | * @param string $field |
||
202 | * @return $this |
||
203 | */ |
||
204 | 13 | public function field($field) |
|
210 | |||
211 | /** |
||
212 | * Add $geoIntersects criteria with a GeoJSON geometry to the query. |
||
213 | * |
||
214 | * The geometry parameter GeoJSON object or an array corresponding to the |
||
215 | * geometry's JSON representation. |
||
216 | * |
||
217 | * @see Expr::geoIntersects() |
||
218 | * @see http://docs.mongodb.org/manual/reference/operator/geoIntersects/ |
||
219 | * @param array|Geometry $geometry |
||
220 | * @return $this |
||
221 | */ |
||
222 | 1 | public function geoIntersects($geometry) |
|
228 | |||
229 | /** |
||
230 | * Add $geoWithin criteria with a GeoJSON geometry to the query. |
||
231 | * |
||
232 | * The geometry parameter GeoJSON object or an array corresponding to the |
||
233 | * geometry's JSON representation. |
||
234 | * |
||
235 | * @see Expr::geoWithin() |
||
236 | * @see http://docs.mongodb.org/manual/reference/operator/geoWithin/ |
||
237 | * @param array|Geometry $geometry |
||
238 | * @return $this |
||
239 | */ |
||
240 | 1 | public function geoWithin(Geometry $geometry) |
|
246 | |||
247 | /** |
||
248 | * Add $geoWithin criteria with a $box shape to the query. |
||
249 | * |
||
250 | * A rectangular polygon will be constructed from a pair of coordinates |
||
251 | * corresponding to the bottom left and top right corners. |
||
252 | * |
||
253 | * Note: the $box operator only supports legacy coordinate pairs and 2d |
||
254 | * indexes. This cannot be used with 2dsphere indexes and GeoJSON shapes. |
||
255 | * |
||
256 | * @see Expr::geoWithinBox() |
||
257 | * @see http://docs.mongodb.org/manual/reference/operator/box/ |
||
258 | * @param float $x1 |
||
259 | * @param float $y1 |
||
260 | * @param float $x2 |
||
261 | * @param float $y2 |
||
262 | * @return $this |
||
263 | */ |
||
264 | 1 | public function geoWithinBox($x1, $y1, $x2, $y2) |
|
270 | |||
271 | /** |
||
272 | * Add $geoWithin criteria with a $center shape to the query. |
||
273 | * |
||
274 | * Note: the $center operator only supports legacy coordinate pairs and 2d |
||
275 | * indexes. This cannot be used with 2dsphere indexes and GeoJSON shapes. |
||
276 | * |
||
277 | * @see Expr::geoWithinCenter() |
||
278 | * @see http://docs.mongodb.org/manual/reference/operator/center/ |
||
279 | * @param float $x |
||
280 | * @param float $y |
||
281 | * @param float $radius |
||
282 | * @return $this |
||
283 | */ |
||
284 | 1 | public function geoWithinCenter($x, $y, $radius) |
|
290 | |||
291 | /** |
||
292 | * Add $geoWithin criteria with a $centerSphere shape to the query. |
||
293 | * |
||
294 | * Note: the $centerSphere operator supports both 2d and 2dsphere indexes. |
||
295 | * |
||
296 | * @see Expr::geoWithinCenterSphere() |
||
297 | * @see http://docs.mongodb.org/manual/reference/operator/centerSphere/ |
||
298 | * @param float $x |
||
299 | * @param float $y |
||
300 | * @param float $radius |
||
301 | * @return $this |
||
302 | */ |
||
303 | 1 | public function geoWithinCenterSphere($x, $y, $radius) |
|
309 | |||
310 | /** |
||
311 | * Add $geoWithin criteria with a $polygon shape to the query. |
||
312 | * |
||
313 | * Point coordinates are in x, y order (easting, northing for projected |
||
314 | * coordinates, longitude, latitude for geographic coordinates). |
||
315 | * |
||
316 | * The last point coordinate is implicitly connected with the first. |
||
317 | * |
||
318 | * Note: the $polygon operator only supports legacy coordinate pairs and 2d |
||
319 | * indexes. This cannot be used with 2dsphere indexes and GeoJSON shapes. |
||
320 | * |
||
321 | * @see Expr::geoWithinPolygon() |
||
322 | * @see http://docs.mongodb.org/manual/reference/operator/polygon/ |
||
323 | * @param array $point,... Three or more point coordinate tuples |
||
324 | * @return $this |
||
325 | */ |
||
326 | 1 | public function geoWithinPolygon(/* array($x1, $y1), ... */) |
|
332 | |||
333 | /** |
||
334 | * {@inheritdoc} |
||
335 | */ |
||
336 | 9 | public function getExpression() |
|
342 | |||
343 | /** |
||
344 | * Specify $gt criteria for the current field. |
||
345 | * |
||
346 | * @see Expr::gt() |
||
347 | * @see http://docs.mongodb.org/manual/reference/operator/gt/ |
||
348 | * @param mixed $value |
||
349 | * @return $this |
||
350 | */ |
||
351 | 2 | public function gt($value) |
|
357 | |||
358 | /** |
||
359 | * Specify $gte criteria for the current field. |
||
360 | * |
||
361 | * @see Expr::gte() |
||
362 | * @see http://docs.mongodb.org/manual/reference/operator/gte/ |
||
363 | * @param mixed $value |
||
364 | * @return $this |
||
365 | */ |
||
366 | 2 | public function gte($value) |
|
372 | |||
373 | /** |
||
374 | * Specify $in criteria for the current field. |
||
375 | * |
||
376 | * @see Expr::in() |
||
377 | * @see http://docs.mongodb.org/manual/reference/operator/in/ |
||
378 | * @param array $values |
||
379 | * @return $this |
||
380 | */ |
||
381 | 2 | public function in(array $values) |
|
387 | |||
388 | /** |
||
389 | * @param object $document |
||
390 | * @return $this |
||
391 | */ |
||
392 | public function includesReferenceTo($document) |
||
398 | |||
399 | /** |
||
400 | * Set the $language option for $text criteria. |
||
401 | * |
||
402 | * This method must be called after text(). |
||
403 | * |
||
404 | * @see Expr::language() |
||
405 | * @see http://docs.mongodb.org/manual/reference/operator/text/ |
||
406 | * @param string $language |
||
407 | * @return $this |
||
408 | */ |
||
409 | 1 | public function language($language) |
|
415 | |||
416 | /** |
||
417 | * Specify $lt criteria for the current field. |
||
418 | * |
||
419 | * @see Expr::lte() |
||
420 | * @see http://docs.mongodb.org/manual/reference/operator/lte/ |
||
421 | * @param mixed $value |
||
422 | * @return $this |
||
423 | */ |
||
424 | public function lt($value) |
||
430 | |||
431 | /** |
||
432 | * Specify $lte criteria for the current field. |
||
433 | * |
||
434 | * @see Expr::lte() |
||
435 | * @see http://docs.mongodb.org/manual/reference/operator/lte/ |
||
436 | * @param mixed $value |
||
437 | * @return $this |
||
438 | */ |
||
439 | 1 | public function lte($value) |
|
445 | |||
446 | /** |
||
447 | * Add $maxDistance criteria to the query. |
||
448 | * |
||
449 | * If the query uses GeoJSON points, $maxDistance will be interpreted in |
||
450 | * meters. If legacy point coordinates are used, $maxDistance will be |
||
451 | * interpreted in radians. |
||
452 | * |
||
453 | * @see Expr::maxDistance() |
||
454 | * @see http://docs.mongodb.org/manual/reference/command/geoNear/ |
||
455 | * @see http://docs.mongodb.org/manual/reference/operator/maxDistance/ |
||
456 | * @see http://docs.mongodb.org/manual/reference/operator/near/ |
||
457 | * @see http://docs.mongodb.org/manual/reference/operator/nearSphere/ |
||
458 | * @param float $maxDistance |
||
459 | * @return $this |
||
460 | */ |
||
461 | public function maxDistance($maxDistance) |
||
467 | |||
468 | /** |
||
469 | * Add $minDistance criteria to the query. |
||
470 | * |
||
471 | * If the query uses GeoJSON points, $minDistance will be interpreted in |
||
472 | * meters. If legacy point coordinates are used, $minDistance will be |
||
473 | * interpreted in radians. |
||
474 | * |
||
475 | * @see Expr::minDistance() |
||
476 | * @see http://docs.mongodb.org/manual/reference/command/geoNear/ |
||
477 | * @see http://docs.mongodb.org/manual/reference/operator/minDistance/ |
||
478 | * @see http://docs.mongodb.org/manual/reference/operator/near/ |
||
479 | * @see http://docs.mongodb.org/manual/reference/operator/nearSphere/ |
||
480 | * @param float $minDistance |
||
481 | * @return $this |
||
482 | */ |
||
483 | public function minDistance($minDistance) |
||
489 | |||
490 | /** |
||
491 | * Specify $mod criteria for the current field. |
||
492 | * |
||
493 | * @see Expr::mod() |
||
494 | * @see http://docs.mongodb.org/manual/reference/operator/mod/ |
||
495 | * @param float|integer $divisor |
||
496 | * @param float|integer $remainder |
||
497 | * @return $this |
||
498 | */ |
||
499 | 1 | public function mod($divisor, $remainder = 0) |
|
505 | |||
506 | /** |
||
507 | * Negates an expression for the current field. |
||
508 | * |
||
509 | * You can create a new expression using the {@link Builder::matchExpr()} |
||
510 | * method. |
||
511 | * |
||
512 | * @see Expr::not() |
||
513 | * @see http://docs.mongodb.org/manual/reference/operator/not/ |
||
514 | * @param array|Expr $expression |
||
515 | * @return $this |
||
516 | */ |
||
517 | 1 | public function not($expression) |
|
523 | |||
524 | /** |
||
525 | * Specify $ne criteria for the current field. |
||
526 | * |
||
527 | * @see Expr::notEqual() |
||
528 | * @see http://docs.mongodb.org/manual/reference/operator/ne/ |
||
529 | * @param mixed $value |
||
530 | * @return $this |
||
531 | */ |
||
532 | 2 | public function notEqual($value) |
|
538 | |||
539 | /** |
||
540 | * Specify $nin criteria for the current field. |
||
541 | * |
||
542 | * @see Expr::notIn() |
||
543 | * @see http://docs.mongodb.org/manual/reference/operator/nin/ |
||
544 | * @param array $values |
||
545 | * @return $this |
||
546 | */ |
||
547 | 1 | public function notIn(array $values) |
|
553 | |||
554 | /** |
||
555 | * Specify $gte and $lt criteria for the current field. |
||
556 | * |
||
557 | * This method is shorthand for specifying $gte criteria on the lower bound |
||
558 | * and $lt criteria on the upper bound. The upper bound is not inclusive. |
||
559 | * |
||
560 | * @see Expr::range() |
||
561 | * @param mixed $start |
||
562 | * @param mixed $end |
||
563 | * @return $this |
||
564 | */ |
||
565 | 1 | public function range($start, $end) |
|
571 | |||
572 | /** |
||
573 | * @param object $document |
||
574 | * @return $this |
||
575 | */ |
||
576 | public function references($document) |
||
582 | |||
583 | /** |
||
584 | * Specify $size criteria for the current field. |
||
585 | * |
||
586 | * @see Expr::size() |
||
587 | * @see http://docs.mongodb.org/manual/reference/operator/size/ |
||
588 | * @param integer $size |
||
589 | * @return $this |
||
590 | */ |
||
591 | 1 | public function size($size) |
|
597 | |||
598 | /** |
||
599 | * Specify $text criteria for the current field. |
||
600 | * |
||
601 | * The $language option may be set with {@link Builder::language()}. |
||
602 | * |
||
603 | * You can only use this in the first $match stage of a pipeline. |
||
604 | * |
||
605 | * @see Expr::text() |
||
606 | * @see http://docs.mongodb.org/master/reference/operator/query/text/ |
||
607 | * @param string $search |
||
608 | * @return $this |
||
609 | */ |
||
610 | 1 | public function text($search) |
|
616 | |||
617 | /** |
||
618 | * Specify $type criteria for the current field. |
||
619 | * |
||
620 | * @see Expr::type() |
||
621 | * @see http://docs.mongodb.org/manual/reference/operator/type/ |
||
622 | * @param integer $type |
||
623 | * @return $this |
||
624 | */ |
||
625 | 1 | public function type($type) |
|
631 | } |
||
632 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.