1 | <?php |
||
5 | abstract class AbstractSpecification implements SpecificationInterface |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | protected $field; |
||
11 | |||
12 | /** |
||
13 | * @var string|null |
||
14 | */ |
||
15 | protected $dqlAlias; |
||
16 | |||
17 | /** |
||
18 | * @param string $field |
||
19 | * @param string|null $dqlAlias |
||
20 | */ |
||
21 | public function __construct($field, $dqlAlias = null) |
||
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | public function isSatisfiedBy($value) |
||
34 | |||
35 | /** |
||
36 | * Create a formatted string for the given property prefixed with the DQL alias. |
||
37 | * |
||
38 | * @param string $dqlAlias |
||
39 | * |
||
40 | * @return string |
||
41 | */ |
||
42 | protected function createPropertyWithAlias($dqlAlias) |
||
43 | { |
||
44 | return $this->createAliasedName($this->field, $dqlAlias); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Create a formatted string where the value will be prefixed with DQL alias (if not already present). |
||
49 | * |
||
50 | * @param string $value |
||
51 | * @param string $dqlAlias |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | protected function createAliasedName($value, $dqlAlias) |
||
67 | } |
||
68 |