1 | <?php |
||
24 | class DataTablesRequest implements DataTablesRequestInterface, HTTPInterface { |
||
25 | |||
26 | /** |
||
27 | * Columns. |
||
28 | * |
||
29 | * @var DataTablesColumn[] |
||
30 | */ |
||
31 | private $columns; |
||
32 | |||
33 | /** |
||
34 | * Draw. |
||
35 | * |
||
36 | * @var integer |
||
37 | */ |
||
38 | private $draw; |
||
39 | |||
40 | /** |
||
41 | * Length. |
||
42 | * |
||
43 | * @var integer |
||
44 | */ |
||
45 | private $length; |
||
46 | |||
47 | /** |
||
48 | * Order. |
||
49 | * |
||
50 | * @var DataTablesOrder[] |
||
51 | */ |
||
52 | private $order; |
||
53 | |||
54 | /** |
||
55 | * Query. |
||
56 | * |
||
57 | * @var ParameterBag |
||
58 | */ |
||
59 | private $query; |
||
60 | |||
61 | /** |
||
62 | * Request. |
||
63 | * |
||
64 | * @var ParameterBag |
||
65 | */ |
||
66 | private $request; |
||
67 | |||
68 | /** |
||
69 | * Search. |
||
70 | * |
||
71 | * @var DataTablesSearch |
||
72 | */ |
||
73 | private $search; |
||
74 | |||
75 | /** |
||
76 | * Start. |
||
77 | * |
||
78 | * @var integer |
||
79 | */ |
||
80 | private $start; |
||
81 | |||
82 | /** |
||
83 | * Wrapper. |
||
84 | * |
||
85 | * @var DataTablesWrapper |
||
86 | */ |
||
87 | private $wrapper; |
||
88 | |||
89 | /** |
||
90 | * Constructor. |
||
91 | */ |
||
92 | protected function __construct() { |
||
101 | |||
102 | /** |
||
103 | * DataTables parameters. |
||
104 | * |
||
105 | * @return array Returns the DataTables parameters. |
||
106 | */ |
||
107 | public static function dtParameters() { |
||
117 | |||
118 | /** |
||
119 | * Get a column. |
||
120 | * |
||
121 | * @param string $data The column data. |
||
122 | * @return array Returns the column in case of success, null otherwise. |
||
123 | */ |
||
124 | public function getColumn($data) { |
||
132 | |||
133 | /** |
||
134 | * Get the columns. |
||
135 | * |
||
136 | * @return DataTablesColumn[] Returns the columns. |
||
137 | */ |
||
138 | public function getColumns() { |
||
141 | |||
142 | /** |
||
143 | * Get the draw. |
||
144 | * |
||
145 | * @return integer Returns the draw. |
||
146 | */ |
||
147 | public function getDraw() { |
||
150 | |||
151 | /** |
||
152 | * Get the length. |
||
153 | * |
||
154 | * @return integer Returns the length. |
||
155 | */ |
||
156 | public function getLength() { |
||
159 | |||
160 | /** |
||
161 | * Get the order. |
||
162 | * |
||
163 | * @return DataTablesOrder[] Returns the order. |
||
164 | */ |
||
165 | public function getOrder() { |
||
168 | |||
169 | /** |
||
170 | * Get the query. |
||
171 | * |
||
172 | * @return ParameterBag Returns the query. |
||
173 | */ |
||
174 | public function getQuery() { |
||
177 | |||
178 | /** |
||
179 | * Get the request. |
||
180 | * |
||
181 | * @return ParameterBag Returns the request. |
||
182 | */ |
||
183 | public function getRequest() { |
||
186 | |||
187 | /** |
||
188 | * Get the search. |
||
189 | * |
||
190 | * @return DatTablesSearch Returns the search. |
||
191 | */ |
||
192 | public function getSearch() { |
||
195 | |||
196 | /** |
||
197 | * Get the start. |
||
198 | * |
||
199 | * @return integer Returns the start. |
||
200 | */ |
||
201 | public function getStart() { |
||
204 | |||
205 | /** |
||
206 | * Get the wrapper. |
||
207 | * |
||
208 | * @return DataTablesWrapper Returns the wrapper. |
||
209 | */ |
||
210 | public function getWrapper() { |
||
213 | |||
214 | /** |
||
215 | * Parse a request. |
||
216 | * |
||
217 | * @param DataTablesWrapper $wrapper The wrapper. |
||
218 | * @param Request $request The request. |
||
219 | * @return DataTablesRequest Returns the DataTables request. |
||
220 | */ |
||
221 | public static function parse(DataTablesWrapper $wrapper, Request $request) { |
||
254 | |||
255 | /** |
||
256 | * Recopy. |
||
257 | * |
||
258 | * @param ParameterBag $request The request. |
||
259 | * @param ParameterBag $bag The bag. |
||
260 | * @return void |
||
261 | */ |
||
262 | protected static function recopy(ParameterBag $request, ParameterBag $bag) { |
||
270 | |||
271 | /** |
||
272 | * Set the columns. |
||
273 | * |
||
274 | * @param DataTablesColumn[] $columns The columns. |
||
275 | * @return DataTablesRequest Returns this DataTables request. |
||
276 | */ |
||
277 | protected function setColumns($columns) { |
||
281 | |||
282 | /** |
||
283 | * Set the draw. |
||
284 | * |
||
285 | * @param integer $draw The draw. |
||
286 | * @return DataTablesRequest Returns this DataTables request. |
||
287 | */ |
||
288 | protected function setDraw($draw) { |
||
292 | |||
293 | /** |
||
294 | * Set the length. |
||
295 | * |
||
296 | * @param integer $length The length. |
||
297 | * @return DataTablesRequest Returns this DataTables request. |
||
298 | */ |
||
299 | protected function setLength($length) { |
||
303 | |||
304 | /** |
||
305 | * Set the order. |
||
306 | * |
||
307 | * @param DataTablesOrder[] $order The order. |
||
308 | * @return DataTablesRequest Returns this DataTables request. |
||
309 | */ |
||
310 | protected function setOrder($order) { |
||
314 | |||
315 | /** |
||
316 | * Set the request. |
||
317 | * |
||
318 | * @param ParameterBag $query The query. |
||
319 | * @return DataTablesRequest Returns this DataTables request. |
||
320 | */ |
||
321 | protected function setQuery(ParameterBag $query) { |
||
325 | |||
326 | /** |
||
327 | * Set the request. |
||
328 | * |
||
329 | * @param ParameterBag $request The request. |
||
330 | * @return DataTablesRequest Returns this DataTables request. |
||
331 | */ |
||
332 | protected function setRequest(ParameterBag $request) { |
||
336 | |||
337 | /** |
||
338 | * Set the search. |
||
339 | * |
||
340 | * @param DataTablesSearch $search The search. |
||
341 | * @return DataTablesRequest Returns this DataTables request. |
||
342 | */ |
||
343 | protected function setSearch(DataTablesSearch $search) { |
||
347 | |||
348 | /** |
||
349 | * Set the start. |
||
350 | * |
||
351 | * @param integer $start The start. |
||
352 | * @return DataTablesRequest Returns this DataTables request. |
||
353 | */ |
||
354 | protected function setStart($start) { |
||
358 | |||
359 | /** |
||
360 | * Set the wrapper. |
||
361 | * |
||
362 | * @param DataTablesWrapper $wrapper The wrapper. |
||
363 | * @return DataTablesRequest Returns this DataTables request. |
||
364 | */ |
||
365 | protected function setWrapper(DataTablesWrapper $wrapper) { |
||
369 | |||
370 | } |
||
371 |