|
@@ 325-334 (lines=10) @@
|
| 322 |
|
* |
| 323 |
|
* @return Expression |
| 324 |
|
*/ |
| 325 |
|
public function whereOr($expressions = null /**, ...**/) |
| 326 |
|
{ |
| 327 |
|
if ($expressions instanceof Expression) { |
| 328 |
|
$expressions = func_get_args(); |
| 329 |
|
} |
| 330 |
|
|
| 331 |
|
return $this->where('$or', array_map(function (Expression $expression) { |
| 332 |
|
return $expression->toArray(); |
| 333 |
|
}, $expressions)); |
| 334 |
|
} |
| 335 |
|
|
| 336 |
|
/** |
| 337 |
|
* Select the documents that satisfy all the expressions in the array |
|
@@ 342-351 (lines=10) @@
|
| 339 |
|
* @param array|\Sokil\Mongo\Expression $expressions Array of Expression instances or comma delimited expression list |
| 340 |
|
* @return Expression |
| 341 |
|
*/ |
| 342 |
|
public function whereAnd($expressions = null /**, ...**/) |
| 343 |
|
{ |
| 344 |
|
if ($expressions instanceof Expression) { |
| 345 |
|
$expressions = func_get_args(); |
| 346 |
|
} |
| 347 |
|
|
| 348 |
|
return $this->where('$and', array_map(function (Expression $expression) { |
| 349 |
|
return $expression->toArray(); |
| 350 |
|
}, $expressions)); |
| 351 |
|
} |
| 352 |
|
|
| 353 |
|
/** |
| 354 |
|
* Selects the documents that fail all the query expressions in the array |
|
@@ 359-368 (lines=10) @@
|
| 356 |
|
* @param array|\Sokil\Mongo\Expression $expressions Array of Expression instances or comma delimited expression list |
| 357 |
|
* @return Expression |
| 358 |
|
*/ |
| 359 |
|
public function whereNor($expressions = null /**, ...**/) |
| 360 |
|
{ |
| 361 |
|
if ($expressions instanceof Expression) { |
| 362 |
|
$expressions = func_get_args(); |
| 363 |
|
} |
| 364 |
|
|
| 365 |
|
return $this->where( |
| 366 |
|
'$nor', |
| 367 |
|
array_map( |
| 368 |
|
function (Expression $expression) { |
| 369 |
|
return $expression->toArray(); |
| 370 |
|
}, |
| 371 |
|
$expressions |