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 | * Order. |
||
55 | * |
||
56 | * @var array |
||
57 | */ |
||
58 | private $order; |
||
59 | |||
60 | /** |
||
61 | * Processing. |
||
62 | * |
||
63 | * @var boolean |
||
64 | */ |
||
65 | private $processing; |
||
66 | |||
67 | /** |
||
68 | * Request. |
||
69 | * |
||
70 | * @var DataTablesRequest |
||
71 | */ |
||
72 | private $request; |
||
73 | |||
74 | /** |
||
75 | * Response. |
||
76 | * |
||
77 | * @var DataTablesResponse |
||
78 | */ |
||
79 | private $response; |
||
80 | |||
81 | /** |
||
82 | * Server side. |
||
83 | * |
||
84 | * @var boolean |
||
85 | */ |
||
86 | private $serverSide; |
||
87 | |||
88 | /** |
||
89 | * URL. |
||
90 | * |
||
91 | * @var string |
||
92 | */ |
||
93 | private $url; |
||
94 | |||
95 | /** |
||
96 | * Constructor. |
||
97 | * |
||
98 | * @param string $method The method. |
||
99 | * @param string $url The URL. |
||
100 | * @param string $name The name. |
||
101 | */ |
||
102 | public function __construct($method, $url, $name) { |
||
113 | |||
114 | /** |
||
115 | * Add a column. |
||
116 | * |
||
117 | * @param DataTablesColumn $column The column. |
||
118 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
119 | */ |
||
120 | public function addColumn(DataTablesColumn $column) { |
||
127 | |||
128 | /** |
||
129 | * Get a column. |
||
130 | * |
||
131 | * @param string $data The column data. |
||
132 | * @return DataTablesColumn Returns the column in case of success, null otherwise. |
||
133 | */ |
||
134 | public function getColumn($data) { |
||
140 | |||
141 | /** |
||
142 | * Get the columns. |
||
143 | * |
||
144 | * @return DataTablesColumn[] Returns the columns. |
||
145 | */ |
||
146 | public function getColumns() { |
||
149 | |||
150 | /** |
||
151 | * Get the mapping. |
||
152 | * |
||
153 | * @return DataTablesMapping Returns the mapping. |
||
154 | */ |
||
155 | public function getMapping() { |
||
158 | |||
159 | /** |
||
160 | * Get the method. |
||
161 | * |
||
162 | * @return string Returns the method. |
||
163 | */ |
||
164 | public function getMethod() { |
||
167 | |||
168 | /** |
||
169 | * Get the name. |
||
170 | * |
||
171 | * @return string Returns the name. |
||
172 | */ |
||
173 | public function getName() { |
||
176 | |||
177 | /** |
||
178 | * Get the order. |
||
179 | * |
||
180 | * @return array Returns the order. |
||
181 | */ |
||
182 | public function getOrder() { |
||
185 | |||
186 | /** |
||
187 | * Get the processing. |
||
188 | * |
||
189 | * @return boolean Returns the processing. |
||
190 | */ |
||
191 | public function getProcessing() { |
||
194 | |||
195 | /** |
||
196 | * Get the request. |
||
197 | * |
||
198 | * @return DataTablesRequest The request. |
||
199 | */ |
||
200 | public function getRequest() { |
||
203 | |||
204 | /** |
||
205 | * Get the response. |
||
206 | * |
||
207 | * @return DataTablesResponse Returns the response. |
||
208 | */ |
||
209 | public function getResponse() { |
||
212 | |||
213 | /** |
||
214 | * Get the server side. |
||
215 | * |
||
216 | * @return boolean Returns the server side. |
||
217 | */ |
||
218 | public function getServerSide() { |
||
221 | |||
222 | /** |
||
223 | * Get the URL. |
||
224 | * |
||
225 | * @return string Returns the URL. |
||
226 | */ |
||
227 | public function getUrl() { |
||
230 | |||
231 | /** |
||
232 | * Parse a request. |
||
233 | * |
||
234 | * @param Request $request The request. |
||
235 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
236 | */ |
||
237 | public function parse(Request $request) { |
||
242 | |||
243 | /** |
||
244 | * Remove a column. |
||
245 | * |
||
246 | * @param DataTablesColumn $column The column. |
||
247 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
248 | */ |
||
249 | public function removeColumn(DataTablesColumn $column) { |
||
256 | |||
257 | /** |
||
258 | * Set the columns. |
||
259 | * |
||
260 | * @param DataTablesColumn[] $columns The columns. |
||
261 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
262 | */ |
||
263 | private function setColumns(array $columns) { |
||
267 | |||
268 | /** |
||
269 | * Set the method. |
||
270 | * |
||
271 | * @param string $method The method. |
||
272 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
273 | */ |
||
274 | public function setMethod($method) { |
||
278 | |||
279 | /** |
||
280 | * Set the name. |
||
281 | * |
||
282 | * @param string $name The name. |
||
283 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
284 | */ |
||
285 | public function setName($name) { |
||
289 | |||
290 | /** |
||
291 | * Set the order. |
||
292 | * |
||
293 | * @param array $order The order. |
||
294 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
295 | */ |
||
296 | public function setOrder(array $order) { |
||
300 | |||
301 | /** |
||
302 | * Set the processing. |
||
303 | * |
||
304 | * @param boolean $processing The processing. |
||
305 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
306 | */ |
||
307 | public function setProcessing($processing) { |
||
311 | |||
312 | /** |
||
313 | * Set the server side. |
||
314 | * |
||
315 | * @param boolean $serverSide The server side. |
||
316 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
317 | */ |
||
318 | public function setServerSide($serverSide) { |
||
322 | |||
323 | /** |
||
324 | * Set the URL. |
||
325 | * |
||
326 | * @param string $url The UTL. |
||
327 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
328 | */ |
||
329 | public function setUrl($url) { |
||
333 | |||
334 | } |
||
335 |