1 | <?php |
||
17 | class MappedOrderByAdapter implements OrderByCriteriaInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var OrderByCriteriaInterface |
||
21 | */ |
||
22 | private $orderBy; |
||
23 | |||
24 | /** |
||
25 | * @var array|\ArrayAccess |
||
26 | */ |
||
27 | private $fieldsMap; |
||
28 | |||
29 | /** |
||
30 | * @param OrderByCriteriaInterface $orderBy |
||
31 | * @param array|\ArrayAccess $fieldsMap keys will be visible to user, |
||
32 | * values to CriteriaBuilder |
||
33 | */ |
||
34 | 7 | public function __construct( |
|
42 | |||
43 | /** |
||
44 | * @return string|null Returns null if user will enter value that is not in fieldsMap |
||
45 | */ |
||
46 | 2 | public function getMappedOrderBy() |
|
54 | |||
55 | /** |
||
56 | * @return array|\ArrayAccess |
||
57 | */ |
||
58 | 1 | public function getFieldsMap() |
|
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | 3 | public function getOrderBy() |
|
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | 4 | public function setOrderBy($orderBy) |
|
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | 2 | public function shouldBeApplied() |
|
86 | |||
87 | /** |
||
88 | * @param mixed $fieldsMap |
||
89 | * |
||
90 | * @throws \InvalidArgumentException |
||
91 | */ |
||
92 | 7 | private function checkFieldsMapType($fieldsMap) |
|
103 | |||
104 | /** |
||
105 | * @return bool |
||
106 | */ |
||
107 | 3 | private function rawValueExistsInFieldsMap() |
|
111 | } |
||
112 |