1 | <?php |
||
28 | final class DataTablesWrapper implements HTTPMethodInterface { |
||
29 | |||
30 | /** |
||
31 | * Columns. |
||
32 | * |
||
33 | * @var DataTablesColumn[] |
||
34 | */ |
||
35 | private $columns; |
||
36 | |||
37 | /** |
||
38 | * Mapping. |
||
39 | * |
||
40 | * @var DataTablesMapping |
||
41 | */ |
||
42 | private $mapping; |
||
43 | |||
44 | /** |
||
45 | * Method. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | private $method; |
||
50 | |||
51 | /** |
||
52 | * Order. |
||
53 | * |
||
54 | * @var array |
||
55 | */ |
||
56 | private $order; |
||
57 | |||
58 | /** |
||
59 | * Processing. |
||
60 | * |
||
61 | * @var boolean |
||
62 | */ |
||
63 | private $processing; |
||
64 | |||
65 | /** |
||
66 | * Request. |
||
67 | * |
||
68 | * @var DataTablesRequest |
||
69 | */ |
||
70 | private $request; |
||
71 | |||
72 | /** |
||
73 | * Response. |
||
74 | * |
||
75 | * @var DataTablesResponse |
||
76 | */ |
||
77 | private $response; |
||
78 | |||
79 | /** |
||
80 | * Route. |
||
81 | * |
||
82 | * @var string |
||
83 | */ |
||
84 | private $route; |
||
85 | |||
86 | /** |
||
87 | * Server side. |
||
88 | * |
||
89 | * @var boolean |
||
90 | */ |
||
91 | private $serverSide; |
||
92 | |||
93 | /** |
||
94 | * Constructor. |
||
95 | * |
||
96 | * @param string $method The method. |
||
97 | * @param string $route The route. |
||
98 | * @param string $prefix The prefix. |
||
99 | */ |
||
100 | public function __construct($method, $route, $prefix) { |
||
111 | |||
112 | /** |
||
113 | * Add a column. |
||
114 | * |
||
115 | * @param DataTablesColumn $column The column. |
||
116 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
117 | */ |
||
118 | public function addColumn(DataTablesColumn $column) { |
||
125 | |||
126 | /** |
||
127 | * Get a column. |
||
128 | * |
||
129 | * @param string $name The column name. |
||
130 | * @return DataTablesColumn Returns the DataTables column in case of success, null otherwise. |
||
131 | */ |
||
132 | public function getColumn($name) { |
||
138 | |||
139 | /** |
||
140 | * Get the columns. |
||
141 | * |
||
142 | * @return DataTablesColumn[] Returns the columns. |
||
143 | */ |
||
144 | public function getColumns() { |
||
147 | |||
148 | /** |
||
149 | * Get the mapping. |
||
150 | * |
||
151 | * @return DataTablesMapping The mapping. |
||
152 | */ |
||
153 | public function getMapping() { |
||
156 | |||
157 | /** |
||
158 | * Get the method. |
||
159 | * |
||
160 | * @return string Returns the method. |
||
161 | */ |
||
162 | public function getMethod() { |
||
165 | |||
166 | /** |
||
167 | * Get the order. |
||
168 | * |
||
169 | * @return array Returns the order. |
||
170 | */ |
||
171 | public function getOrder() { |
||
174 | |||
175 | /** |
||
176 | * Get the processing. |
||
177 | * |
||
178 | * @return boolean Returns the processing. |
||
179 | */ |
||
180 | public function getProcessing() { |
||
183 | |||
184 | /** |
||
185 | * Get the request. |
||
186 | * |
||
187 | * @return DataTablesRequest The request. |
||
188 | */ |
||
189 | public function getRequest() { |
||
192 | |||
193 | /** |
||
194 | * Get the response. |
||
195 | * |
||
196 | * @return DataTablesResponse Returns the response. |
||
197 | */ |
||
198 | public function getResponse() { |
||
201 | |||
202 | /** |
||
203 | * Get the route. |
||
204 | * |
||
205 | * @return string Returns the route. |
||
206 | */ |
||
207 | public function getRoute() { |
||
210 | |||
211 | /** |
||
212 | * Get the server side. |
||
213 | * |
||
214 | * @return boolean Returns the server side. |
||
215 | */ |
||
216 | public function getServerSide() { |
||
219 | |||
220 | /** |
||
221 | * Parse a request. |
||
222 | * |
||
223 | * @param Request $request The request. |
||
224 | */ |
||
225 | public function parse(Request $request) { |
||
229 | |||
230 | /** |
||
231 | * Remove a column. |
||
232 | * |
||
233 | * @param DataTablesColumn $column The column. |
||
234 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
235 | */ |
||
236 | public function removeColumn(DataTablesColumn $column) { |
||
243 | |||
244 | /** |
||
245 | * Set the columns. |
||
246 | * |
||
247 | * @param DataTablesColumn[] $columns The columns. |
||
248 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
249 | */ |
||
250 | private function setColumns(array $columns) { |
||
254 | |||
255 | /** |
||
256 | * Set the method. |
||
257 | * |
||
258 | * @param string $method The method. |
||
259 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
260 | */ |
||
261 | public function setMethod($method) { |
||
272 | |||
273 | /** |
||
274 | * Set the order. |
||
275 | * |
||
276 | * @param array $order The order. |
||
277 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
278 | */ |
||
279 | public function setOrder(array $order) { |
||
283 | |||
284 | /** |
||
285 | * Set the processing. |
||
286 | * |
||
287 | * @param boolean $processing The processing. |
||
288 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
289 | */ |
||
290 | public function setProcessing($processing) { |
||
302 | |||
303 | /** |
||
304 | * Set the route. |
||
305 | * |
||
306 | * @param string $route The route. |
||
307 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
308 | */ |
||
309 | public function setRoute($route) { |
||
313 | |||
314 | /** |
||
315 | * Set the server side. |
||
316 | * |
||
317 | * @param boolean $serverSide The server side. |
||
318 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
319 | */ |
||
320 | public function setServerSide($serverSide) { |
||
332 | |||
333 | } |
||
334 |