1 | <?php |
||
12 | class Datatable110QueryParser extends QueryParser |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * Method to determine if this parser can handle the query parameters. If so then the parser should return true |
||
17 | * and be able to return a DTQueryConfiguration |
||
18 | * |
||
19 | * @param Request $request The current request, that should be investigated |
||
20 | * @return bool true if the parser is able to parse the query parameters and to return a DTQueryConfiguration |
||
21 | */ |
||
22 | public function canParse(Request $request) |
||
26 | |||
27 | /** |
||
28 | * Method that should parse the request and return a DTQueryConfiguration |
||
29 | * |
||
30 | * @param Request $request The current request that should be investigated |
||
31 | * @param ColumnConfiguration[] $columnConfiguration The configuration of the columns |
||
32 | * @return QueryConfiguration the configuration the provider can use to prepare the data |
||
33 | */ |
||
34 | public function parse(Request $request, array $columnConfiguration) |
||
55 | |||
56 | /** |
||
57 | * Helper function that will check if a variable is empty |
||
58 | * @param mixed $string |
||
59 | * @return bool true if empty, false otherwise |
||
60 | */ |
||
61 | private function isEmpty($string) |
||
65 | |||
66 | /** |
||
67 | * Helper function that will check if an array key exists |
||
68 | * @param mixed $array |
||
69 | * @param string $key key to check |
||
70 | * @return bool true if array & exists, false otherwise |
||
71 | */ |
||
72 | private function isArrayAndHasKey($array, $key) |
||
84 | |||
85 | /** |
||
86 | * @param ParameterBag $query |
||
87 | * @param QueryConfigurationBuilder $builder |
||
88 | */ |
||
89 | public function getDrawCall($query, $builder) |
||
95 | |||
96 | /** |
||
97 | * @param ParameterBag $query |
||
98 | * @param QueryConfigurationBuilder $builder |
||
99 | */ |
||
100 | public function getStart($query, $builder) |
||
106 | |||
107 | /** |
||
108 | * @param ParameterBag $query |
||
109 | * @param QueryConfigurationBuilder $builder |
||
110 | */ |
||
111 | public function getLength($query, $builder) |
||
117 | |||
118 | /** |
||
119 | * @param ParameterBag $query |
||
120 | * @param QueryConfigurationBuilder $builder |
||
121 | */ |
||
122 | public function getSearch($query, $builder) |
||
130 | |||
131 | /** |
||
132 | * @param ParameterBag $query |
||
133 | * @param QueryConfigurationBuilder $builder |
||
134 | */ |
||
135 | public function getSearchColumns($query, $builder, array $columnConfiguration) |
||
149 | |||
150 | /** |
||
151 | * @param array $columns incoming column request |
||
152 | * @param QueryConfigurationBuilder $builder |
||
153 | * @param ColumnConfiguration $column |
||
154 | * @param integer $position position of the column in the columnConfiguration loop |
||
155 | */ |
||
156 | private function addColumnSearchToBuilderIfRequested($columns, $builder, $column, $position) |
||
167 | |||
168 | /** |
||
169 | * @param ParameterBag $query |
||
170 | * @param QueryConfigurationBuilder $builder |
||
171 | */ |
||
172 | public function getRegex($query, $builder) |
||
180 | |||
181 | /** |
||
182 | * @param ParameterBag $query |
||
183 | * @param QueryConfigurationBuilder $builder |
||
184 | * @param ColumnConfiguration[] $columnConfiguration |
||
185 | */ |
||
186 | private function getOrder(ParameterBag $query, QueryConfigurationBuilder $builder, array $columnConfiguration) |
||
201 | } |
||
202 |