1 | <?php |
||
25 | final class DataTablesResponse implements DataTablesResponseInterface, JsonSerializable { |
||
26 | |||
27 | /** |
||
28 | * Data. |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | private $data; |
||
33 | |||
34 | /** |
||
35 | * Draw. |
||
36 | * |
||
37 | * @var integer |
||
38 | */ |
||
39 | private $draw; |
||
40 | |||
41 | /** |
||
42 | * Error. |
||
43 | * |
||
44 | * @var string |
||
45 | */ |
||
46 | private $error; |
||
47 | |||
48 | /** |
||
49 | * Records filtered. |
||
50 | * |
||
51 | * @var integer |
||
52 | */ |
||
53 | private $recordsFiltered; |
||
54 | |||
55 | /** |
||
56 | * Records total. |
||
57 | * |
||
58 | * @var integer |
||
59 | */ |
||
60 | private $recordsTotal; |
||
61 | |||
62 | /** |
||
63 | * Wrapper. |
||
64 | * |
||
65 | * @var DataTablesWrapper |
||
66 | */ |
||
67 | private $wrapper; |
||
68 | |||
69 | /** |
||
70 | * Constructor. |
||
71 | * |
||
72 | * @param DataTablesWrapper $wrapper The DataTables wrapper. |
||
73 | * @param DataTablesRequest $request The DataTables request. |
||
74 | */ |
||
75 | public function __construct(DataTablesWrapper $wrapper, DataTablesRequest $request) { |
||
82 | |||
83 | /** |
||
84 | * Add a row. |
||
85 | * |
||
86 | * @return DataTablesResponse Returns the DataTables response. |
||
87 | */ |
||
88 | public function addRow() { |
||
103 | |||
104 | /** |
||
105 | * Get the data. |
||
106 | * |
||
107 | * @return array Returns the data. |
||
108 | */ |
||
109 | public function getData() { |
||
112 | |||
113 | /** |
||
114 | * Get the draw |
||
115 | * |
||
116 | * @return integer Returns the draw. |
||
117 | */ |
||
118 | public function getDraw() { |
||
121 | |||
122 | /** |
||
123 | * Get the error. |
||
124 | * |
||
125 | * @return string Returns the error. |
||
126 | */ |
||
127 | public function getError() { |
||
130 | |||
131 | /** |
||
132 | * Get the records filtered. |
||
133 | * |
||
134 | * @return integer The records filtered. |
||
135 | */ |
||
136 | public function getRecordsFiltered() { |
||
139 | |||
140 | /** |
||
141 | * Get the records total. |
||
142 | * |
||
143 | * @return integer Returns the records total. |
||
144 | */ |
||
145 | public function getRecordsTotal() { |
||
148 | |||
149 | /** |
||
150 | * Get the wrapper. |
||
151 | * |
||
152 | * @return DataTablesWrapper Returns the wrapper. |
||
153 | */ |
||
154 | public function getWrapper() { |
||
157 | |||
158 | /** |
||
159 | * {@inheritdoc} |
||
160 | */ |
||
161 | public function jsonSerialize() { |
||
164 | |||
165 | /** |
||
166 | * Set the draw. |
||
167 | * |
||
168 | * @param integer $draw The draw. |
||
169 | * @return DataTablesResponse Returns the DataTables response. |
||
170 | */ |
||
171 | private function setDraw($draw) { |
||
175 | |||
176 | /** |
||
177 | * Set the data. |
||
178 | * |
||
179 | * @param array $data The data. |
||
180 | * @return DataTablesResponse Returns the DataTables response. |
||
181 | */ |
||
182 | private function setData(array $data) { |
||
186 | |||
187 | /** |
||
188 | * Set the error. |
||
189 | * |
||
190 | * @param string $error The error. |
||
191 | * @return DataTablesResponse Returns the DataTables response. |
||
192 | */ |
||
193 | public function setError($error) { |
||
197 | |||
198 | /** |
||
199 | * Set the records filtered. |
||
200 | * |
||
201 | * @param integer $recordsFiltered The records filtered. |
||
202 | * @return DataTablesResponse Returns the DataTables response. |
||
203 | */ |
||
204 | public function setRecordsFiltered($recordsFiltered) { |
||
208 | |||
209 | /** |
||
210 | * Set the records total. |
||
211 | * |
||
212 | * @param integer $recordsTotal The records total. |
||
213 | * @return DataTablesResponse Returns the DataTables response. |
||
214 | */ |
||
215 | public function setRecordsTotal($recordsTotal) { |
||
219 | |||
220 | /** |
||
221 | * Set a row value. |
||
222 | * |
||
223 | * @param string $name The column name. |
||
224 | * @param string $value The column value. |
||
225 | * @return DataTablesResponse Returns the DataTables response. |
||
226 | */ |
||
227 | public function setRow($name, $value) { |
||
247 | |||
248 | /** |
||
249 | * Set the wrapper. |
||
250 | * |
||
251 | * @param DataTablesWrapper $wrapper The wrapper. |
||
252 | * @return DataTablesResponse Returns the DataTables request. |
||
253 | */ |
||
254 | private function setWrapper(DataTablesWrapper $wrapper) { |
||
258 | |||
259 | /** |
||
260 | * Convert into an array representing this instance. |
||
261 | * |
||
262 | * @return array Returns an array representing this instance. |
||
263 | */ |
||
264 | public function toArray() { |
||
277 | |||
278 | } |
||
279 |