1 | <?php |
||
7 | abstract class CriterionHandler implements Handler |
||
8 | { |
||
9 | /** |
||
10 | * Check if this criterion handler accepts to handle the given criterion. |
||
11 | * |
||
12 | * @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion |
||
13 | * |
||
14 | * @return bool |
||
15 | */ |
||
16 | abstract public function accept(Criterion $criterion); |
||
17 | |||
18 | /** |
||
19 | * Generate query expression for a Criterion this handler accepts. |
||
20 | * |
||
21 | * accept() must be called before calling this method. |
||
22 | * |
||
23 | * @param CriteriaConverter $converter |
||
24 | * @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion |
||
25 | */ |
||
26 | abstract public function handle(CriteriaConverter $converter, Criterion $criterion); |
||
27 | |||
28 | /** |
||
29 | * @param string $value |
||
30 | * |
||
31 | * @return string |
||
32 | * |
||
33 | * @todo if we get passed a string such as 'xxx AND hello', we should probbaly add double quotes around it, as we |
||
34 | * will otherwise most likely be attempting a match for the world 'hello' on any field, not just one |
||
35 | */ |
||
36 | protected function escapeValue($value) |
||
44 | |||
45 | /** |
||
46 | * @param int $value timestamp |
||
47 | */ |
||
48 | protected function formatDate($value) |
||
52 | } |
||
53 |