1 | <?php |
||
23 | class SimpleTermDecorator implements OperatorDecoratorInterface |
||
24 | { |
||
25 | |||
26 | 3 | public function useWith($key, $value) |
|
27 | { |
||
28 | // Do not use with $* operators |
||
29 | 3 | if (strpos($key, '$') === 0) |
|
30 | { |
||
31 | return false; |
||
32 | } |
||
33 | // Special case for mongo id... |
||
34 | 3 | if ($value instanceof MongoId) |
|
35 | { |
||
36 | return true; |
||
37 | } |
||
38 | // Use only with simple values |
||
39 | 3 | return is_scalar($value); |
|
40 | } |
||
41 | |||
42 | 3 | public function decorate(&$condition, $name, $value) |
|
50 | |||
51 | } |
||
52 |