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) { |
||
122 | |||
123 | /** |
||
124 | * Get the columns. |
||
125 | * |
||
126 | * @return DataTablesColumn[] Returns the columns. |
||
127 | */ |
||
128 | public function getColumns() { |
||
131 | |||
132 | /** |
||
133 | * Get the mapping. |
||
134 | * |
||
135 | * @return DataTablesMapping The mapping. |
||
136 | */ |
||
137 | public function getMapping() { |
||
140 | |||
141 | /** |
||
142 | * Get the method. |
||
143 | * |
||
144 | * @return string Returns the method. |
||
145 | */ |
||
146 | public function getMethod() { |
||
149 | |||
150 | /** |
||
151 | * Get the order. |
||
152 | * |
||
153 | * @return array Returns the order. |
||
154 | */ |
||
155 | public function getOrder() { |
||
158 | |||
159 | /** |
||
160 | * Get the processing. |
||
161 | * |
||
162 | * @return boolean Returns the processing. |
||
163 | */ |
||
164 | public function getProcessing() { |
||
167 | |||
168 | /** |
||
169 | * Get the request. |
||
170 | * |
||
171 | * @return DataTablesRequest The request. |
||
172 | */ |
||
173 | public function getRequest() { |
||
176 | |||
177 | /** |
||
178 | * Get the response. |
||
179 | * |
||
180 | * @return DataTablesResponse Returns the response. |
||
181 | */ |
||
182 | public function getResponse() { |
||
185 | |||
186 | /** |
||
187 | * Get the route. |
||
188 | * |
||
189 | * @return string Returns the reoute. |
||
190 | */ |
||
191 | public function getRoute() { |
||
194 | |||
195 | /** |
||
196 | * Get the server side. |
||
197 | * |
||
198 | * @return boolean Returns the server side. |
||
199 | */ |
||
200 | public function getServerSide() { |
||
203 | |||
204 | /** |
||
205 | * Remove a column. |
||
206 | * |
||
207 | * @param DataTablesColumn $column The column. |
||
208 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
209 | */ |
||
210 | public function removeColumn(DataTablesColumn $column) { |
||
217 | |||
218 | /** |
||
219 | * Set the columns. |
||
220 | * |
||
221 | * @param DataTablesColumn[] $columns The columns. |
||
222 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
223 | */ |
||
224 | private function setColumns(array $columns) { |
||
228 | |||
229 | /** |
||
230 | * Set the method. |
||
231 | * |
||
232 | * @param string $method The method. |
||
233 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
234 | */ |
||
235 | public function setMethod($method) { |
||
246 | |||
247 | /** |
||
248 | * Set the order. |
||
249 | * |
||
250 | * @param array $order The order. |
||
251 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
252 | */ |
||
253 | public function setOrder(array $order) { |
||
257 | |||
258 | /** |
||
259 | * Set the processing. |
||
260 | * |
||
261 | * @param boolean $processing The processing. |
||
262 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
263 | */ |
||
264 | public function setProcessing($processing) { |
||
276 | |||
277 | /** |
||
278 | * Set the route. |
||
279 | * |
||
280 | * @param string $route The route. |
||
281 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
282 | */ |
||
283 | public function setRoute($route) { |
||
287 | |||
288 | /** |
||
289 | * Set the server side. |
||
290 | * |
||
291 | * @param boolean $serverSide The server side. |
||
292 | * @return DataTablesWrapper Returns the DataTables wrapper. |
||
293 | */ |
||
294 | public function setServerSide($serverSide) { |
||
306 | |||
307 | } |
||
308 |
As per the PSR-2 coding standard, there must not be a space in front of the colon in case statements.
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.