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 | * @param DataTablesWrapper $wrapper The DataTables wrapper. |
||
70 | * @param DataTablesRequest $request The DataTables request. |
||
71 | */ |
||
72 | public function __construct(DataTablesWrapper $wrapper, DataTablesRequest $request) { |
||
79 | |||
80 | /** |
||
81 | * Add a row. |
||
82 | * |
||
83 | * @return DataTablesResponse Returns the DataTables response. |
||
84 | */ |
||
85 | public function addRow() { |
||
100 | |||
101 | /** |
||
102 | * Get the data. |
||
103 | * |
||
104 | * @return array Returns the data. |
||
105 | */ |
||
106 | public function getData() { |
||
109 | |||
110 | /** |
||
111 | * Get the draw |
||
112 | * |
||
113 | * @return integer Returns the draw. |
||
114 | */ |
||
115 | public function getDraw() { |
||
118 | |||
119 | /** |
||
120 | * Get the error. |
||
121 | * |
||
122 | * @return string Returns the error. |
||
123 | */ |
||
124 | public function getError() { |
||
127 | |||
128 | /** |
||
129 | * Get the records filtered. |
||
130 | * |
||
131 | * @return integer The records filtered. |
||
132 | */ |
||
133 | public function getRecordsFiltered() { |
||
136 | |||
137 | /** |
||
138 | * Get the records total. |
||
139 | * |
||
140 | * @return integer Returns the records total. |
||
141 | */ |
||
142 | public function getRecordsTotal() { |
||
145 | |||
146 | /** |
||
147 | * Get the wrapper. |
||
148 | * |
||
149 | * @return DataTablesWrapper Returns the wrapper. |
||
150 | */ |
||
151 | public function getWrapper() { |
||
154 | |||
155 | /** |
||
156 | * {@inheritdoc} |
||
157 | */ |
||
158 | public function jsonSerialize() { |
||
161 | |||
162 | /** |
||
163 | * Set the draw. |
||
164 | * |
||
165 | * @param integer $draw The draw. |
||
166 | * @return DataTablesResponse Returns the DataTables response. |
||
167 | */ |
||
168 | private function setDraw($draw) { |
||
172 | |||
173 | /** |
||
174 | * Set the data. |
||
175 | * |
||
176 | * @param array $data The data. |
||
177 | * @return DataTablesResponse Returns this DataTables response. |
||
178 | */ |
||
179 | private function setData(array $data) { |
||
183 | |||
184 | /** |
||
185 | * Set the error. |
||
186 | * |
||
187 | * @param string $error The error. |
||
188 | * @return DataTablesResponse Returns this DataTables response. |
||
189 | */ |
||
190 | public function setError($error) { |
||
194 | |||
195 | /** |
||
196 | * Set the records filtered. |
||
197 | * |
||
198 | * @param integer $recordsFiltered The records filtered. |
||
199 | * @return DataTablesResponse Returns this DataTables response. |
||
200 | */ |
||
201 | public function setRecordsFiltered($recordsFiltered) { |
||
205 | |||
206 | /** |
||
207 | * Set the records total. |
||
208 | * |
||
209 | * @param integer $recordsTotal The records total. |
||
210 | * @return DataTablesResponse Returns this DataTables response. |
||
211 | */ |
||
212 | public function setRecordsTotal($recordsTotal) { |
||
216 | |||
217 | /** |
||
218 | * Set a row value. |
||
219 | * |
||
220 | * @param string $name The column name. |
||
221 | * @param string $value The column value. |
||
222 | * @return DataTablesResponse Returns this DataTables response. |
||
223 | */ |
||
224 | public function setRow($name, $value) { |
||
244 | |||
245 | /** |
||
246 | * Set the wrapper. |
||
247 | * |
||
248 | * @param DataTablesWrapper $wrapper The wrapper. |
||
249 | * @return DataTablesResponse Returns this DataTables request. |
||
250 | */ |
||
251 | private function setWrapper(DataTablesWrapper $wrapper) { |
||
255 | |||
256 | /** |
||
257 | * Convert into an array representing this instance. |
||
258 | * |
||
259 | * @return array Returns an array representing this instance. |
||
260 | */ |
||
261 | public function toArray() { |
||
274 | |||
275 | } |
||
276 |