1 | <?php |
||
22 | class DataTablesResponse implements DataTablesResponseInterface, JsonSerializable { |
||
23 | |||
24 | /** |
||
25 | * Data. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | private $data; |
||
30 | |||
31 | /** |
||
32 | * Draw. |
||
33 | * |
||
34 | * @var integer |
||
35 | */ |
||
36 | private $draw; |
||
37 | |||
38 | /** |
||
39 | * Error. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | private $error; |
||
44 | |||
45 | /** |
||
46 | * Records filtered. |
||
47 | * |
||
48 | * @var integer |
||
49 | */ |
||
50 | private $recordsFiltered; |
||
51 | |||
52 | /** |
||
53 | * Records total. |
||
54 | * |
||
55 | * @var integer |
||
56 | */ |
||
57 | private $recordsTotal; |
||
58 | |||
59 | /** |
||
60 | * Wrapper. |
||
61 | * |
||
62 | * @var DataTablesWrapper |
||
63 | */ |
||
64 | private $wrapper; |
||
65 | |||
66 | /** |
||
67 | * Constructor. |
||
68 | */ |
||
69 | protected function __construct() { |
||
75 | |||
76 | /** |
||
77 | * Add a row. |
||
78 | * |
||
79 | * @return DataTablesResponse Returns this DataTables response. |
||
80 | */ |
||
81 | public function addRow() { |
||
96 | |||
97 | /** |
||
98 | * Optional parameters. |
||
99 | * |
||
100 | * @return array Returns the optional parameters. |
||
101 | */ |
||
102 | public static function dtRow() { |
||
110 | |||
111 | /** |
||
112 | * Get the data. |
||
113 | * |
||
114 | * @return array Returns the data. |
||
115 | */ |
||
116 | public function getData() { |
||
119 | |||
120 | /** |
||
121 | * Get the draw |
||
122 | * |
||
123 | * @return integer Returns the draw. |
||
124 | */ |
||
125 | public function getDraw() { |
||
128 | |||
129 | /** |
||
130 | * Get the error. |
||
131 | * |
||
132 | * @return string Returns the error. |
||
133 | */ |
||
134 | public function getError() { |
||
137 | |||
138 | /** |
||
139 | * Get the records filtered. |
||
140 | * |
||
141 | * @return integer The records filtered. |
||
142 | */ |
||
143 | public function getRecordsFiltered() { |
||
146 | |||
147 | /** |
||
148 | * Get the records total. |
||
149 | * |
||
150 | * @return integer Returns the records total. |
||
151 | */ |
||
152 | public function getRecordsTotal() { |
||
155 | |||
156 | /** |
||
157 | * Get the wrapper. |
||
158 | * |
||
159 | * @return DataTablesWrapper Returns the wrapper. |
||
160 | */ |
||
161 | public function getWrapper() { |
||
164 | |||
165 | /** |
||
166 | * {@inheritdoc} |
||
167 | */ |
||
168 | public function jsonSerialize() { |
||
171 | |||
172 | /** |
||
173 | * Create a DataTables response instance. |
||
174 | * |
||
175 | * @param DataTablesWrapper $wrapper The wrapper. |
||
176 | * @param DataTablesRequest $request The request. |
||
177 | * @return DataTablesResponse Returns the DataTables response. |
||
178 | */ |
||
179 | public static function parse(DataTablesWrapper $wrapper, DataTablesRequest $request) { |
||
189 | |||
190 | /** |
||
191 | * Set the data. |
||
192 | * |
||
193 | * @param array $data The data. |
||
194 | * @return DataTablesResponse Returns this DataTables response. |
||
195 | */ |
||
196 | protected function setData(array $data) { |
||
200 | |||
201 | /** |
||
202 | * Set the draw. |
||
203 | * |
||
204 | * @param integer $draw The draw. |
||
205 | * @return DataTablesResponse Returns the DataTables response. |
||
206 | */ |
||
207 | protected function setDraw($draw) { |
||
211 | |||
212 | /** |
||
213 | * Set the error. |
||
214 | * |
||
215 | * @param string $error The error. |
||
216 | * @return DataTablesResponse Returns this DataTables response. |
||
217 | */ |
||
218 | public function setError($error) { |
||
222 | |||
223 | /** |
||
224 | * Set the records filtered. |
||
225 | * |
||
226 | * @param integer $recordsFiltered The records filtered. |
||
227 | * @return DataTablesResponse Returns this DataTables response. |
||
228 | */ |
||
229 | public function setRecordsFiltered($recordsFiltered) { |
||
233 | |||
234 | /** |
||
235 | * Set the records total. |
||
236 | * |
||
237 | * @param integer $recordsTotal The records total. |
||
238 | * @return DataTablesResponse Returns this DataTables response. |
||
239 | */ |
||
240 | public function setRecordsTotal($recordsTotal) { |
||
244 | |||
245 | /** |
||
246 | * Set a row value. |
||
247 | * |
||
248 | * @param string $data The column data. |
||
249 | * @param string $value The column value. |
||
250 | * @return DataTablesResponse Returns this DataTables response. |
||
251 | */ |
||
252 | public function setRow($data, $value) { |
||
265 | |||
266 | /** |
||
267 | * Set the wrapper. |
||
268 | * |
||
269 | * @param DataTablesWrapper $wrapper The wrapper. |
||
270 | * @return DataTablesResponse Returns this DataTables response. |
||
271 | */ |
||
272 | protected function setWrapper(DataTablesWrapper $wrapper) { |
||
276 | |||
277 | /** |
||
278 | * Convert into an array representing this instance. |
||
279 | * |
||
280 | * @return array Returns an array representing this instance. |
||
281 | */ |
||
282 | public function toArray() { |
||
295 | |||
296 | } |
||
297 |