1 | <?php |
||
22 | class DataTablesResponse implements DataTablesResponseInterface { |
||
23 | |||
24 | /** |
||
25 | * Data. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | private $data; |
||
30 | |||
31 | /** |
||
32 | * Draw. |
||
33 | * |
||
34 | * @var int |
||
35 | */ |
||
36 | private $draw; |
||
37 | |||
38 | /** |
||
39 | * Error. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | private $error; |
||
44 | |||
45 | /** |
||
46 | * Records filtered. |
||
47 | * |
||
48 | * @var int |
||
49 | */ |
||
50 | private $recordsFiltered; |
||
51 | |||
52 | /** |
||
53 | * Records total. |
||
54 | * |
||
55 | * @var int |
||
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 | * {@inheritdoc} |
||
78 | */ |
||
79 | public function addRow() { |
||
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | public function countRows() { |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function getData() { |
||
108 | |||
109 | /** |
||
110 | * {@inheritdoc} |
||
111 | */ |
||
112 | public function getDraw() { |
||
115 | |||
116 | /** |
||
117 | * {@inheritdoc} |
||
118 | */ |
||
119 | public function getError() { |
||
122 | |||
123 | /** |
||
124 | * {@inheritdoc} |
||
125 | */ |
||
126 | public function getRecordsFiltered() { |
||
129 | |||
130 | /** |
||
131 | * {@inheritdoc} |
||
132 | */ |
||
133 | public function getRecordsTotal() { |
||
136 | |||
137 | /** |
||
138 | * {@inheritdoc} |
||
139 | */ |
||
140 | public function getWrapper() { |
||
143 | |||
144 | /** |
||
145 | * {@inheritdoc} |
||
146 | */ |
||
147 | public function jsonSerialize() { |
||
150 | |||
151 | /** |
||
152 | * Create a response instance. |
||
153 | * |
||
154 | * @param DataTablesWrapper $wrapper The wrapper. |
||
155 | * @param DataTablesRequestInterface $request The request. |
||
156 | * @return DataTablesResponseInterface Returns the response. |
||
157 | */ |
||
158 | public static function parse(DataTablesWrapper $wrapper, DataTablesRequestInterface $request) { |
||
168 | |||
169 | /** |
||
170 | * Set the data. |
||
171 | * |
||
172 | * @param array $data The data. |
||
173 | * @return DataTablesResponseInterface Returns this response. |
||
174 | */ |
||
175 | protected function setData(array $data) { |
||
179 | |||
180 | /** |
||
181 | * Set the draw. |
||
182 | * |
||
183 | * @param int $draw The draw. |
||
184 | * @return DataTablesResponseInterface Returns the response. |
||
185 | */ |
||
186 | protected function setDraw($draw) { |
||
190 | |||
191 | /** |
||
192 | * {@inheritdoc} |
||
193 | */ |
||
194 | public function setError($error) { |
||
198 | |||
199 | /** |
||
200 | * {@inheritdoc} |
||
201 | */ |
||
202 | public function setRecordsFiltered($recordsFiltered) { |
||
206 | |||
207 | /** |
||
208 | * {@inheritdoc} |
||
209 | */ |
||
210 | public function setRecordsTotal($recordsTotal) { |
||
214 | |||
215 | /** |
||
216 | * {@inheritdoc} |
||
217 | */ |
||
218 | public function setRow($data, $value) { |
||
231 | |||
232 | /** |
||
233 | * Set the wrapper. |
||
234 | * |
||
235 | * @param DataTablesWrapper $wrapper The wrapper. |
||
236 | * @return DataTablesResponseInterface Returns this response. |
||
237 | */ |
||
238 | protected function setWrapper(DataTablesWrapper $wrapper) { |
||
242 | |||
243 | /** |
||
244 | * Convert into an array representing this instance. |
||
245 | * |
||
246 | * @return array Returns an array representing this instance. |
||
247 | */ |
||
248 | public function toArray() { |
||
261 | |||
262 | } |
||
263 |