1 | <?php |
||
13 | class SymfonyExpression extends Expression implements CallbackInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var ExpressionLanguage |
||
17 | */ |
||
18 | private $expressionLanguage; |
||
19 | |||
20 | /** |
||
21 | * @var ParsedExpression |
||
22 | */ |
||
23 | private $parsedExpression; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | private $keys; |
||
29 | |||
30 | /** |
||
31 | * @param string $expression |
||
32 | * @param array $keys |
||
33 | * @param ExpressionLanguage $expressionLanguage |
||
34 | */ |
||
35 | 3 | public function __construct($expression, array $keys = array(), ExpressionLanguage $expressionLanguage = null) |
|
36 | 1 | { |
|
37 | 3 | parent::__construct($expression); |
|
38 | 3 | $this->keys = $keys; |
|
39 | 3 | if ($expressionLanguage) { |
|
40 | $this->expressionLanguage = $expressionLanguage; |
||
41 | } else { |
||
42 | 3 | $this->expressionLanguage = new ExpressionLanguage(); |
|
43 | } |
||
44 | 3 | } |
|
45 | |||
46 | /** |
||
47 | * @return \Symfony\Component\ExpressionLanguage\ParsedExpression |
||
48 | */ |
||
49 | 2 | protected function getExpression() |
|
57 | |||
58 | /** |
||
59 | * @return string |
||
60 | */ |
||
61 | 2 | public function __invoke() |
|
72 | |||
73 | /** |
||
74 | * @return array |
||
75 | */ |
||
76 | 1 | public function getKeys() |
|
80 | } |
||
81 |