src/Pipeline.php 1 location
|
@@ 67-71 (lines=5) @@
|
64 |
|
call_user_func($expressionConfigurator, $expression); |
65 |
|
} |
66 |
|
|
67 |
|
if ($expression instanceof Expression) { |
68 |
|
$expression = $expression->toArray(); |
69 |
|
} elseif (!is_array($expression)) { |
70 |
|
throw new Exception('Must be array, callable or instance of \Sokil\Mongo\Expression'); |
71 |
|
} |
72 |
|
|
73 |
|
$this->addStage('$match', $expression); |
74 |
|
return $this; |
src/Operator.php 1 location
|
@@ 280-284 (lines=5) @@
|
277 |
|
call_user_func($configurator, $expression); |
278 |
|
} |
279 |
|
|
280 |
|
if ($expression instanceof Expression) { |
281 |
|
$expression = $expression->toArray(); |
282 |
|
} elseif (!is_array($expression)) { |
283 |
|
throw new \InvalidArgumentException('Expression must be field name, callable or Expression object'); |
284 |
|
} |
285 |
|
|
286 |
|
if (!isset($this->operators['$pull'])) { |
287 |
|
// no $pull operator found |
src/Expression.php 1 location
|
@@ 283-287 (lines=5) @@
|
280 |
|
$expression = call_user_func($expression, $this->expression()); |
281 |
|
} |
282 |
|
|
283 |
|
if ($expression instanceof Expression) { |
284 |
|
$expression = $expression->toArray(); |
285 |
|
} elseif (!is_array($expression)) { |
286 |
|
throw new Exception('Wrong expression passed'); |
287 |
|
} |
288 |
|
|
289 |
|
return $this->where($field, array('$elemMatch' => $expression)); |
290 |
|
} |