1 | <?php |
||
23 | class DataTablesWrapper implements HTTPInterface { |
||
24 | |||
25 | /** |
||
26 | * Columns. |
||
27 | * |
||
28 | * @var DataTablesColumn[] |
||
29 | */ |
||
30 | private $columns; |
||
31 | |||
32 | /** |
||
33 | * Mapping. |
||
34 | * |
||
35 | * @var DataTablesMapping |
||
36 | */ |
||
37 | private $mapping; |
||
38 | |||
39 | /** |
||
40 | * Method. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | private $method; |
||
45 | |||
46 | /** |
||
47 | * Name. |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | private $name; |
||
52 | |||
53 | /** |
||
54 | * Options. |
||
55 | * |
||
56 | * @var DataTablesOptions |
||
57 | */ |
||
58 | private $options; |
||
59 | |||
60 | /** |
||
61 | * Order. |
||
62 | * |
||
63 | * @var array |
||
64 | */ |
||
65 | private $order; |
||
66 | |||
67 | /** |
||
68 | * Processing. |
||
69 | * |
||
70 | * @var boolean |
||
71 | */ |
||
72 | private $processing; |
||
73 | |||
74 | /** |
||
75 | * Request. |
||
76 | * |
||
77 | * @var DataTablesRequest |
||
78 | */ |
||
79 | private $request; |
||
80 | |||
81 | /** |
||
82 | * Response. |
||
83 | * |
||
84 | * @var DataTablesResponse |
||
85 | */ |
||
86 | private $response; |
||
87 | |||
88 | /** |
||
89 | * Server side. |
||
90 | * |
||
91 | * @var boolean |
||
92 | */ |
||
93 | private $serverSide; |
||
94 | |||
95 | /** |
||
96 | * URL. |
||
97 | * |
||
98 | * @var string |
||
99 | */ |
||
100 | private $url; |
||
101 | |||
102 | /** |
||
103 | * Constructor. |
||
104 | * |
||
105 | * @param string $method The method. |
||
106 | * @param string $url The URL. |
||
107 | * @param string $name The name. |
||
108 | */ |
||
109 | public function __construct($method, $url, $name) { |
||
120 | |||
121 | /** |
||
122 | * Add a column. |
||
123 | * |
||
124 | * @param DataTablesColumn $column The column. |
||
125 | * @return DataTablesWrapper Returns this wrapper. |
||
126 | */ |
||
127 | public function addColumn(DataTablesColumn $column) { |
||
134 | |||
135 | /** |
||
136 | * Get a column. |
||
137 | * |
||
138 | * @param string $data The column data. |
||
139 | * @return DataTablesColumn Returns the column in case of success, null otherwise. |
||
140 | */ |
||
141 | public function getColumn($data) { |
||
147 | |||
148 | /** |
||
149 | * Get the columns. |
||
150 | * |
||
151 | * @return DataTablesColumn[] Returns the columns. |
||
152 | */ |
||
153 | public function getColumns() { |
||
156 | |||
157 | /** |
||
158 | * Get the mapping. |
||
159 | * |
||
160 | * @return DataTablesMapping Returns the mapping. |
||
161 | */ |
||
162 | public function getMapping() { |
||
165 | |||
166 | /** |
||
167 | * Get the method. |
||
168 | * |
||
169 | * @return string Returns the method. |
||
170 | */ |
||
171 | public function getMethod() { |
||
174 | |||
175 | /** |
||
176 | * Get the name. |
||
177 | * |
||
178 | * @return string Returns the name. |
||
179 | */ |
||
180 | public function getName() { |
||
183 | |||
184 | /** |
||
185 | * Get the options. |
||
186 | * |
||
187 | * @return DataTablesOptions Returns the options. |
||
188 | */ |
||
189 | public function getOptions() { |
||
192 | |||
193 | /** |
||
194 | * Get the order. |
||
195 | * |
||
196 | * @return array Returns the order. |
||
197 | */ |
||
198 | public function getOrder() { |
||
201 | |||
202 | /** |
||
203 | * Get the processing. |
||
204 | * |
||
205 | * @return boolean Returns the processing. |
||
206 | */ |
||
207 | public function getProcessing() { |
||
210 | |||
211 | /** |
||
212 | * Get the request. |
||
213 | * |
||
214 | * @return DataTablesRequest The request. |
||
215 | */ |
||
216 | public function getRequest() { |
||
219 | |||
220 | /** |
||
221 | * Get the response. |
||
222 | * |
||
223 | * @return DataTablesResponse Returns the response. |
||
224 | */ |
||
225 | public function getResponse() { |
||
228 | |||
229 | /** |
||
230 | * Get the server side. |
||
231 | * |
||
232 | * @return boolean Returns the server side. |
||
233 | */ |
||
234 | public function getServerSide() { |
||
237 | |||
238 | /** |
||
239 | * Get the URL. |
||
240 | * |
||
241 | * @return string Returns the URL. |
||
242 | */ |
||
243 | public function getUrl() { |
||
246 | |||
247 | /** |
||
248 | * Parse a request. |
||
249 | * |
||
250 | * @param Request $request The request. |
||
251 | * @return DataTablesWrapper Returns this wrapper. |
||
252 | */ |
||
253 | public function parse(Request $request) { |
||
258 | |||
259 | /** |
||
260 | * Remove a column. |
||
261 | * |
||
262 | * @param DataTablesColumn $column The column. |
||
263 | * @return DataTablesWrapper Returns this wrapper. |
||
264 | */ |
||
265 | public function removeColumn(DataTablesColumn $column) { |
||
272 | |||
273 | /** |
||
274 | * Set the columns. |
||
275 | * |
||
276 | * @param DataTablesColumn[] $columns The columns. |
||
277 | * @return DataTablesWrapper Returns this wrapper. |
||
278 | */ |
||
279 | private function setColumns(array $columns) { |
||
283 | |||
284 | /** |
||
285 | * Set the method. |
||
286 | * |
||
287 | * @param string $method The method. |
||
288 | * @return DataTablesWrapper Returns this wrapper. |
||
289 | */ |
||
290 | public function setMethod($method) { |
||
294 | |||
295 | /** |
||
296 | * Set the name. |
||
297 | * |
||
298 | * @param string $name The name. |
||
299 | * @return DataTablesWrapper Returns this wrapper. |
||
300 | */ |
||
301 | public function setName($name) { |
||
305 | |||
306 | /** |
||
307 | * Set the options. |
||
308 | * |
||
309 | * @param DataTablesOptions $options The options. |
||
310 | * @return DataTablesWrapper Returns this wrapper. |
||
311 | */ |
||
312 | public function setOptions(DataTablesOptions $options) { |
||
316 | |||
317 | /** |
||
318 | * Set the order. |
||
319 | * |
||
320 | * @param array $order The order. |
||
321 | * @return DataTablesWrapper Returns this wrapper. |
||
322 | */ |
||
323 | public function setOrder(array $order) { |
||
327 | |||
328 | /** |
||
329 | * Set the processing. |
||
330 | * |
||
331 | * @param boolean $processing The processing. |
||
332 | * @return DataTablesWrapper Returns this wrapper. |
||
333 | */ |
||
334 | public function setProcessing($processing) { |
||
338 | |||
339 | /** |
||
340 | * Set the server side. |
||
341 | * |
||
342 | * @param boolean $serverSide The server side. |
||
343 | * @return DataTablesWrapper Returns this wrapper. |
||
344 | */ |
||
345 | public function setServerSide($serverSide) { |
||
349 | |||
350 | /** |
||
351 | * Set the URL. |
||
352 | * |
||
353 | * @param string $url The UTL. |
||
354 | * @return DataTablesWrapper Returns this wrapper. |
||
355 | */ |
||
356 | public function setUrl($url) { |
||
360 | |||
361 | } |
||
362 |