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 | * Order. |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | private $order; |
||
52 | |||
53 | /** |
||
54 | * Processing. |
||
55 | * |
||
56 | * @var boolean |
||
57 | */ |
||
58 | private $processing; |
||
59 | |||
60 | /** |
||
61 | * Request. |
||
62 | * |
||
63 | * @var DataTablesRequest |
||
64 | */ |
||
65 | private $request; |
||
66 | |||
67 | /** |
||
68 | * Response. |
||
69 | * |
||
70 | * @var DataTablesResponse |
||
71 | */ |
||
72 | private $response; |
||
73 | |||
74 | /** |
||
75 | * Server side. |
||
76 | * |
||
77 | * @var boolean |
||
78 | */ |
||
79 | private $serverSide; |
||
80 | |||
81 | /** |
||
82 | * URL. |
||
83 | * |
||
84 | * @var string |
||
85 | */ |
||
86 | private $url; |
||
87 | |||
88 | /** |
||
89 | * Constructor. |
||
90 | * |
||
91 | * @param string $prefix The prefix. |
||
92 | * @param string $method The method. |
||
93 | * @param string $url The URL. |
||
94 | */ |
||
95 | public function __construct($prefix, $method, $url) { |
||
106 | |||
107 | /** |
||
108 | * Add a column. |
||
109 | * |
||
110 | * @param DataTablesColumn $column The column. |
||
111 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
112 | */ |
||
113 | public function addColumn(DataTablesColumn $column) { |
||
120 | |||
121 | /** |
||
122 | * Get a column. |
||
123 | * |
||
124 | * @param string $data The column data. |
||
125 | * @return DataTablesColumn Returns the column in case of success, null otherwise. |
||
126 | */ |
||
127 | public function getColumn($data) { |
||
133 | |||
134 | /** |
||
135 | * Get the columns. |
||
136 | * |
||
137 | * @return DataTablesColumn[] Returns the columns. |
||
138 | */ |
||
139 | public function getColumns() { |
||
142 | |||
143 | /** |
||
144 | * Get the mapping. |
||
145 | * |
||
146 | * @return DataTablesMapping The mapping. |
||
147 | */ |
||
148 | public function getMapping() { |
||
151 | |||
152 | /** |
||
153 | * Get the method. |
||
154 | * |
||
155 | * @return string Returns the method. |
||
156 | */ |
||
157 | public function getMethod() { |
||
160 | |||
161 | /** |
||
162 | * Get the order. |
||
163 | * |
||
164 | * @return array Returns the order. |
||
165 | */ |
||
166 | public function getOrder() { |
||
169 | |||
170 | /** |
||
171 | * Get the processing. |
||
172 | * |
||
173 | * @return boolean Returns the processing. |
||
174 | */ |
||
175 | public function getProcessing() { |
||
178 | |||
179 | /** |
||
180 | * Get the request. |
||
181 | * |
||
182 | * @return DataTablesRequest The request. |
||
183 | */ |
||
184 | public function getRequest() { |
||
187 | |||
188 | /** |
||
189 | * Get the response. |
||
190 | * |
||
191 | * @return DataTablesResponse Returns the response. |
||
192 | */ |
||
193 | public function getResponse() { |
||
196 | |||
197 | /** |
||
198 | * Get the server side. |
||
199 | * |
||
200 | * @return boolean Returns the server side. |
||
201 | */ |
||
202 | public function getServerSide() { |
||
205 | |||
206 | /** |
||
207 | * Get the URL. |
||
208 | * |
||
209 | * @return string Returns the URL. |
||
210 | */ |
||
211 | public function getUrl() { |
||
214 | |||
215 | /** |
||
216 | * Parse a request. |
||
217 | * |
||
218 | * @param Request $request The request. |
||
219 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
220 | */ |
||
221 | public function parse(Request $request) { |
||
226 | |||
227 | /** |
||
228 | * Remove a column. |
||
229 | * |
||
230 | * @param DataTablesColumn $column The column. |
||
231 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
232 | */ |
||
233 | public function removeColumn(DataTablesColumn $column) { |
||
240 | |||
241 | /** |
||
242 | * Set the columns. |
||
243 | * |
||
244 | * @param DataTablesColumn[] $columns The columns. |
||
245 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
246 | */ |
||
247 | private function setColumns(array $columns) { |
||
251 | |||
252 | /** |
||
253 | * Set the method. |
||
254 | * |
||
255 | * @param string $method The method. |
||
256 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
257 | */ |
||
258 | public function setMethod($method) { |
||
262 | |||
263 | /** |
||
264 | * Set the order. |
||
265 | * |
||
266 | * @param array $order The order. |
||
267 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
268 | */ |
||
269 | public function setOrder(array $order) { |
||
273 | |||
274 | /** |
||
275 | * Set the processing. |
||
276 | * |
||
277 | * @param boolean $processing The processing. |
||
278 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
279 | */ |
||
280 | public function setProcessing($processing) { |
||
284 | |||
285 | /** |
||
286 | * Set the server side. |
||
287 | * |
||
288 | * @param boolean $serverSide The server side. |
||
289 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
290 | */ |
||
291 | public function setServerSide($serverSide) { |
||
295 | |||
296 | /** |
||
297 | * Set the URL. |
||
298 | * |
||
299 | * @param string $url The UTL. |
||
300 | * @return DataTablesWrapper Returns this DataTables wrapper. |
||
301 | */ |
||
302 | public function setUrl($url) { |
||
306 | |||
307 | } |
||
308 |