1 | <?php |
||
27 | final class DataTablesWrapper implements HTTPMethodInterface { |
||
28 | |||
29 | /** |
||
30 | * Columns. |
||
31 | * |
||
32 | * @var DataTablesColumn[] |
||
33 | */ |
||
34 | private $columns; |
||
35 | |||
36 | /** |
||
37 | * Mapping. |
||
38 | * |
||
39 | * @var DataTablesMapping |
||
40 | */ |
||
41 | private $mapping; |
||
42 | |||
43 | /** |
||
44 | * Method. |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | private $method; |
||
49 | |||
50 | /** |
||
51 | * Order. |
||
52 | * |
||
53 | * @var array |
||
54 | */ |
||
55 | private $order; |
||
56 | |||
57 | /** |
||
58 | * Processing. |
||
59 | * |
||
60 | * @var boolean |
||
61 | */ |
||
62 | private $processing; |
||
63 | |||
64 | /** |
||
65 | * Request. |
||
66 | * |
||
67 | * @var DataTablesRequest |
||
68 | */ |
||
69 | private $request; |
||
70 | |||
71 | /** |
||
72 | * Response. |
||
73 | * |
||
74 | * @var DataTablesResponse |
||
75 | */ |
||
76 | private $response; |
||
77 | |||
78 | /** |
||
79 | * Route. |
||
80 | * |
||
81 | * @var string |
||
82 | */ |
||
83 | private $route; |
||
84 | |||
85 | /** |
||
86 | * Server side. |
||
87 | * |
||
88 | * @var boolean |
||
89 | */ |
||
90 | private $serverSide; |
||
91 | |||
92 | /** |
||
93 | * Constructor. |
||
94 | * |
||
95 | * @param string $method The method. |
||
96 | * @param string $route The route. |
||
97 | * @param string $prefix The prefix. |
||
98 | */ |
||
99 | public function __construct($method, $route, $prefix) { |
||
110 | |||
111 | /** |
||
112 | * Add a column. |
||
113 | * |
||
114 | * @param DataTablesColumn $column The column. |
||
115 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
116 | */ |
||
117 | public function addColumn(DataTablesColumn $column) { |
||
124 | |||
125 | /** |
||
126 | * Get a column. |
||
127 | * |
||
128 | * @param string $name The column name. |
||
129 | * @return DataTablesColumn Returns the DataTables column in case of success, null otherwise. |
||
130 | */ |
||
131 | public function getColumn($name) { |
||
137 | |||
138 | /** |
||
139 | * Get the columns. |
||
140 | * |
||
141 | * @return DataTablesColumn[] Returns the columns. |
||
142 | */ |
||
143 | public function getColumns() { |
||
146 | |||
147 | /** |
||
148 | * Get the mapping. |
||
149 | * |
||
150 | * @return DataTablesMapping The mapping. |
||
151 | */ |
||
152 | public function getMapping() { |
||
155 | |||
156 | /** |
||
157 | * Get the method. |
||
158 | * |
||
159 | * @return string Returns the method. |
||
160 | */ |
||
161 | public function getMethod() { |
||
164 | |||
165 | /** |
||
166 | * Get the order. |
||
167 | * |
||
168 | * @return array Returns the order. |
||
169 | */ |
||
170 | public function getOrder() { |
||
173 | |||
174 | /** |
||
175 | * Get the processing. |
||
176 | * |
||
177 | * @return boolean Returns the processing. |
||
178 | */ |
||
179 | public function getProcessing() { |
||
182 | |||
183 | /** |
||
184 | * Get the request. |
||
185 | * |
||
186 | * @return DataTablesRequest The request. |
||
187 | */ |
||
188 | public function getRequest() { |
||
191 | |||
192 | /** |
||
193 | * Get the response. |
||
194 | * |
||
195 | * @return DataTablesResponse Returns the response. |
||
196 | */ |
||
197 | public function getResponse() { |
||
200 | |||
201 | /** |
||
202 | * Get the route. |
||
203 | * |
||
204 | * @return string Returns the route. |
||
205 | */ |
||
206 | public function getRoute() { |
||
209 | |||
210 | /** |
||
211 | * Get the server side. |
||
212 | * |
||
213 | * @return boolean Returns the server side. |
||
214 | */ |
||
215 | public function getServerSide() { |
||
218 | |||
219 | /** |
||
220 | * Remove a column. |
||
221 | * |
||
222 | * @param DataTablesColumn $column The column. |
||
223 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
224 | */ |
||
225 | public function removeColumn(DataTablesColumn $column) { |
||
232 | |||
233 | /** |
||
234 | * Set the columns. |
||
235 | * |
||
236 | * @param DataTablesColumn[] $columns The columns. |
||
237 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
238 | */ |
||
239 | private function setColumns(array $columns) { |
||
243 | |||
244 | /** |
||
245 | * Set the method. |
||
246 | * |
||
247 | * @param string $method The method. |
||
248 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
249 | */ |
||
250 | public function setMethod($method) { |
||
261 | |||
262 | /** |
||
263 | * Set the order. |
||
264 | * |
||
265 | * @param array $order The order. |
||
266 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
267 | */ |
||
268 | public function setOrder(array $order) { |
||
272 | |||
273 | /** |
||
274 | * Set the processing. |
||
275 | * |
||
276 | * @param boolean $processing The processing. |
||
277 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
278 | */ |
||
279 | public function setProcessing($processing) { |
||
291 | |||
292 | /** |
||
293 | * Set the route. |
||
294 | * |
||
295 | * @param string $route The route. |
||
296 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
297 | */ |
||
298 | public function setRoute($route) { |
||
302 | |||
303 | /** |
||
304 | * Set the server side. |
||
305 | * |
||
306 | * @param boolean $serverSide The server side. |
||
307 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
308 | */ |
||
309 | public function setServerSide($serverSide) { |
||
321 | |||
322 | } |
||
323 |