1 | <?php |
||
30 | class Expr extends BaseExpr |
||
31 | { |
||
32 | /** |
||
33 | * @var DocumentManager |
||
34 | */ |
||
35 | private $dm; |
||
36 | |||
37 | /** |
||
38 | * @var ClassMetadata |
||
39 | */ |
||
40 | private $class; |
||
41 | |||
42 | /** |
||
43 | * @inheritDoc |
||
44 | */ |
||
45 | 4 | public function __construct(DocumentManager $dm, ClassMetadata $class) |
|
50 | |||
51 | /** |
||
52 | * @param string $fieldName |
||
53 | * @return self |
||
54 | */ |
||
55 | 4 | public function field($fieldName) |
|
63 | |||
64 | /** |
||
65 | * @param mixed|self $expression |
||
66 | * @return mixed |
||
67 | */ |
||
68 | protected function ensureArray($expression) |
||
69 | { |
||
70 | // Convert field names in expressions |
||
71 | if (is_string($expression) && substr($expression, 0, 1) === '$') { |
||
72 | return '$' . $this->getDocumentPersister()->prepareFieldName(substr($expression, 1)); |
||
73 | } |
||
74 | |||
75 | // Convert PHP types to MongoDB types for everything else |
||
76 | return Type::convertPHPToDatabaseValue(parent::ensureArray($expression)); |
||
|
|||
77 | } |
||
78 | |||
79 | /** |
||
80 | * @return \Doctrine\ODM\MongoDB\Persisters\DocumentPersister |
||
81 | */ |
||
82 | 4 | private function getDocumentPersister() |
|
86 | } |
||
87 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.