1 | <?php |
||
30 | class DataTablesWrapper implements DataTablesWrapperInterface, HttpInterface { |
||
31 | |||
32 | use UserTrait { |
||
33 | setUser as public; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Columns. |
||
38 | * |
||
39 | * @var DataTablesColumnInterface[] |
||
40 | */ |
||
41 | private $columns; |
||
42 | |||
43 | /** |
||
44 | * Mapping. |
||
45 | * |
||
46 | * @var DataTablesMappingInterface |
||
47 | */ |
||
48 | private $mapping; |
||
49 | |||
50 | /** |
||
51 | * Method. |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | private $method; |
||
56 | |||
57 | /** |
||
58 | * Options. |
||
59 | * |
||
60 | * @var DataTablesOptionsInterface|null |
||
61 | */ |
||
62 | private $options; |
||
63 | |||
64 | /** |
||
65 | * Processing. |
||
66 | * |
||
67 | * @var bool|null |
||
68 | */ |
||
69 | private $processing; |
||
70 | |||
71 | /** |
||
72 | * Provider. |
||
73 | * |
||
74 | * @var DataTablesProviderInterface|null |
||
75 | */ |
||
76 | private $provider; |
||
77 | |||
78 | /** |
||
79 | * Request. |
||
80 | * |
||
81 | * @var DataTablesRequestInterface|null |
||
82 | */ |
||
83 | private $request; |
||
84 | |||
85 | /** |
||
86 | * Response. |
||
87 | * |
||
88 | * @var DataTablesResponseInterface|null |
||
89 | */ |
||
90 | private $response; |
||
91 | |||
92 | /** |
||
93 | * Server side. |
||
94 | * |
||
95 | * @var bool|null |
||
96 | */ |
||
97 | private $serverSide; |
||
98 | |||
99 | /** |
||
100 | * URL. |
||
101 | * |
||
102 | * @var string|null |
||
103 | */ |
||
104 | private $url; |
||
105 | |||
106 | /** |
||
107 | * Constructor. |
||
108 | */ |
||
109 | public function __construct() { |
||
116 | |||
117 | /** |
||
118 | * {@inheritDoc} |
||
119 | */ |
||
120 | public function addColumn(DataTablesColumnInterface $column): DataTablesWrapperInterface { |
||
127 | |||
128 | /** |
||
129 | * {@inheritDoc} |
||
130 | */ |
||
131 | public function getColumn(string $data): ?DataTablesColumnInterface { |
||
137 | |||
138 | /** |
||
139 | * {@inheritDoc} |
||
140 | */ |
||
141 | public function getColumns(): array { |
||
144 | |||
145 | /** |
||
146 | * {@inheritDoc} |
||
147 | */ |
||
148 | public function getMapping(): DataTablesMappingInterface { |
||
151 | |||
152 | /** |
||
153 | * {@inheritDoc} |
||
154 | */ |
||
155 | public function getMethod(): string { |
||
158 | |||
159 | /** |
||
160 | * {@inheritDoc} |
||
161 | */ |
||
162 | public function getOptions(): ?DataTablesOptionsInterface { |
||
165 | |||
166 | /** |
||
167 | * {@inheritDoc} |
||
168 | */ |
||
169 | public function getProcessing(): ?bool { |
||
172 | |||
173 | /** |
||
174 | * {@inheritDoc} |
||
175 | */ |
||
176 | public function getProvider(): ?DataTablesProviderInterface { |
||
179 | |||
180 | /** |
||
181 | * {@inheritDoc} |
||
182 | */ |
||
183 | public function getRequest(): ?DataTablesRequestInterface { |
||
186 | |||
187 | /** |
||
188 | * {@inheritDoc} |
||
189 | */ |
||
190 | public function getResponse(): ?DataTablesResponseInterface { |
||
193 | |||
194 | /** |
||
195 | * {@inheritDoc} |
||
196 | */ |
||
197 | public function getServerSide(): ?bool { |
||
200 | |||
201 | /** |
||
202 | * {@inheritDoc} |
||
203 | */ |
||
204 | public function getUrl(): ?string { |
||
207 | |||
208 | /** |
||
209 | * Remove a column. |
||
210 | * |
||
211 | * @param DataTablesColumnInterface $column The column. |
||
212 | * @return DataTablesWrapperInterface Returns this wrapper. |
||
213 | */ |
||
214 | public function removeColumn(DataTablesColumnInterface $column): DataTablesWrapperInterface { |
||
221 | |||
222 | /** |
||
223 | * Set the columns. |
||
224 | * |
||
225 | * @param DataTablesColumnInterface[] $columns The columns. |
||
226 | * @return DataTablesWrapperInterface Returns this wrapper. |
||
227 | */ |
||
228 | private function setColumns(array $columns): DataTablesWrapperInterface { |
||
232 | |||
233 | /** |
||
234 | * Set the mapping. |
||
235 | * |
||
236 | * @param DataTablesMappingInterface $mapping The mapping |
||
237 | * @return DataTablesWrapperInterface Returns this wrapper. |
||
238 | */ |
||
239 | public function setMapping(DataTablesMappingInterface $mapping): DataTablesWrapperInterface { |
||
243 | |||
244 | /** |
||
245 | * Set the method. |
||
246 | * |
||
247 | * @param string|null $method The method. |
||
248 | * @return DataTablesWrapperInterface Returns this wrapper. |
||
249 | */ |
||
250 | public function setMethod(?string $method): DataTablesWrapperInterface { |
||
254 | |||
255 | /** |
||
256 | * Set the options. |
||
257 | * |
||
258 | * @param DataTablesOptionsInterface|null $options The options. |
||
259 | * @return DataTablesWrapperInterface Returns this wrapper. |
||
260 | */ |
||
261 | public function setOptions(?DataTablesOptionsInterface $options): DataTablesWrapperInterface { |
||
265 | |||
266 | /** |
||
267 | * Set the processing. |
||
268 | * |
||
269 | * @param bool|null $processing The processing. |
||
270 | * @return DataTablesWrapperInterface Returns this wrapper. |
||
271 | */ |
||
272 | public function setProcessing(?bool $processing): DataTablesWrapperInterface { |
||
276 | |||
277 | /** |
||
278 | * Set the provider. |
||
279 | * |
||
280 | * @param DataTablesProviderInterface|null $provider The provider. |
||
281 | * @return DataTablesWrapperInterface Returns this wrapper. |
||
282 | */ |
||
283 | public function setProvider(?DataTablesProviderInterface $provider): DataTablesWrapperInterface { |
||
287 | |||
288 | /** |
||
289 | * {@inheritDoc} |
||
290 | */ |
||
291 | public function setRequest(?DataTablesRequestInterface $request): DataTablesWrapperInterface { |
||
295 | |||
296 | /** |
||
297 | * {@inheritDoc} |
||
298 | */ |
||
299 | public function setResponse(?DataTablesResponseInterface $response): DataTablesWrapperInterface { |
||
303 | |||
304 | /** |
||
305 | * Set the server side. |
||
306 | * |
||
307 | * @param bool|null $serverSide The server side. |
||
308 | * @return DataTablesWrapperInterface Returns this wrapper. |
||
309 | */ |
||
310 | public function setServerSide(?bool $serverSide): DataTablesWrapperInterface { |
||
314 | |||
315 | /** |
||
316 | * Set the URL. |
||
317 | * |
||
318 | * @param string|null $url The UTL. |
||
319 | * @return DataTablesWrapperInterface Returns this wrapper. |
||
320 | */ |
||
321 | public function setUrl(?string $url): DataTablesWrapperInterface { |
||
325 | } |
||
326 |