1 | <?php |
||
14 | abstract class AbstractHandler implements SortHandlerInterface, FilterHandlerInterface |
||
15 | { |
||
16 | /** @var SortInterface[] */ |
||
17 | protected $sortingFields = []; |
||
18 | |||
19 | /** @var FilterInterface[] */ |
||
20 | protected $filteringFields = []; |
||
21 | |||
22 | /** |
||
23 | * @param SortInterface $sort |
||
24 | */ |
||
25 | public function addSorting(SortInterface $sort):void |
||
29 | |||
30 | /** |
||
31 | * @param FilterInterface $filter |
||
32 | */ |
||
33 | 4 | public function addFilter(FilterInterface $filter): void |
|
37 | |||
38 | /** |
||
39 | * @param SortInterface $sort |
||
40 | * @param string $order |
||
41 | */ |
||
42 | abstract protected function handleSorting(SortInterface $sort, string $order): void; |
||
43 | |||
44 | /** |
||
45 | * @param FilterInterface $filter |
||
46 | * @param mixed $value |
||
47 | */ |
||
48 | abstract protected function handleFiltering(FilterInterface $filter, $value): void; |
||
49 | |||
50 | /** |
||
51 | * @param string $field |
||
52 | * @param string $order |
||
53 | */ |
||
54 | public function sort(string $field, string $order): void |
||
63 | |||
64 | /** |
||
65 | * @param string $field |
||
66 | * @param mixed $value |
||
67 | */ |
||
68 | 3 | public function filter(string $field, $value): void |
|
77 | } |
||
78 |