@@ 304-313 (lines=10) @@ | ||
301 | * @param array|\Sokil\Mongo\Expression $expressions Array of Expression instances or comma delimited expression list |
|
302 | * @return \Sokil\Mongo\Expression |
|
303 | */ |
|
304 | public function whereOr($expressions = null /**, ...**/) |
|
305 | { |
|
306 | if($expressions instanceof Expression) { |
|
307 | $expressions = func_get_args(); |
|
308 | } |
|
309 | ||
310 | return $this->where('$or', array_map(function(Expression $expression) { |
|
311 | return $expression->toArray(); |
|
312 | }, $expressions)); |
|
313 | } |
|
314 | ||
315 | /** |
|
316 | * Select the documents that satisfy all the expressions in the array |
|
@@ 321-330 (lines=10) @@ | ||
318 | * @param array|\Sokil\Mongo\Expression $expressions Array of Expression instances or comma delimited expression list |
|
319 | * @return \Sokil\Mongo\Expression |
|
320 | */ |
|
321 | public function whereAnd($expressions = null /**, ...**/) |
|
322 | { |
|
323 | if($expressions instanceof Expression) { |
|
324 | $expressions = func_get_args(); |
|
325 | } |
|
326 | ||
327 | return $this->where('$and', array_map(function(Expression $expression) { |
|
328 | return $expression->toArray(); |
|
329 | }, $expressions)); |
|
330 | } |
|
331 | ||
332 | /** |
|
333 | * Selects the documents that fail all the query expressions in the array |
|
@@ 338-347 (lines=10) @@ | ||
335 | * @param array|\Sokil\Mongo\Expression $expressions Array of Expression instances or comma delimited expression list |
|
336 | * @return \Sokil\Mongo\Expression |
|
337 | */ |
|
338 | public function whereNor($expressions = null /**, ...**/) |
|
339 | { |
|
340 | if($expressions instanceof Expression) { |
|
341 | $expressions = func_get_args(); |
|
342 | } |
|
343 | ||
344 | return $this->where('$nor', array_map(function(Expression $expression) { |
|
345 | return $expression->toArray(); |
|
346 | }, $expressions)); |
|
347 | } |
|
348 | ||
349 | public function whereNot(Expression $expression) |
|
350 | { |