1 | <?php |
||
23 | class DataTablesResponse implements DataTablesResponseInterface { |
||
24 | |||
25 | use DataTablesWrapperTrait { |
||
26 | setWrapper as public; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Data. |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | private $data; |
||
35 | |||
36 | /** |
||
37 | * Draw. |
||
38 | * |
||
39 | * @var int |
||
40 | */ |
||
41 | private $draw; |
||
42 | |||
43 | /** |
||
44 | * Error. |
||
45 | * |
||
46 | * @var string|null |
||
47 | */ |
||
48 | private $error; |
||
49 | |||
50 | /** |
||
51 | * Records filtered. |
||
52 | * |
||
53 | * @var int |
||
54 | */ |
||
55 | private $recordsFiltered; |
||
56 | |||
57 | /** |
||
58 | * Records total. |
||
59 | * |
||
60 | * @var int |
||
61 | */ |
||
62 | private $recordsTotal; |
||
63 | |||
64 | /** |
||
65 | * Constructor. |
||
66 | */ |
||
67 | public function __construct() { |
||
73 | |||
74 | /** |
||
75 | * {@inheritDoc} |
||
76 | */ |
||
77 | public function addRow(): DataTablesResponseInterface { |
||
90 | |||
91 | /** |
||
92 | * {@inheritDoc} |
||
93 | */ |
||
94 | public function countRows(): int { |
||
97 | |||
98 | /** |
||
99 | * {@inheritDoc} |
||
100 | */ |
||
101 | public function getData(): array { |
||
104 | |||
105 | /** |
||
106 | * {@inheritDoc} |
||
107 | */ |
||
108 | public function getDraw(): int { |
||
111 | |||
112 | /** |
||
113 | * {@inheritDoc} |
||
114 | */ |
||
115 | public function getError(): ?string { |
||
118 | |||
119 | /** |
||
120 | * {@inheritDoc} |
||
121 | */ |
||
122 | public function getRecordsFiltered(): int { |
||
125 | |||
126 | /** |
||
127 | * {@inheritDoc} |
||
128 | */ |
||
129 | public function getRecordsTotal(): int { |
||
132 | |||
133 | /** |
||
134 | * {@inheritDoc} |
||
135 | */ |
||
136 | public function jsonSerialize(): array { |
||
139 | |||
140 | /** |
||
141 | * Set the data. |
||
142 | * |
||
143 | * @param array $data The data. |
||
144 | * @return DataTablesResponseInterface Returns this response. |
||
145 | */ |
||
146 | protected function setData(array $data): DataTablesResponseInterface { |
||
150 | |||
151 | /** |
||
152 | * Set the draw. |
||
153 | * |
||
154 | * @param int $draw The draw. |
||
155 | * @return DataTablesResponseInterface Returns the response. |
||
156 | */ |
||
157 | public function setDraw(int $draw): DataTablesResponseInterface { |
||
161 | |||
162 | /** |
||
163 | * {@inheritDoc} |
||
164 | */ |
||
165 | public function setError(?string $error): DataTablesResponseInterface { |
||
169 | |||
170 | /** |
||
171 | * {@inheritDoc} |
||
172 | */ |
||
173 | public function setRecordsFiltered(int $recordsFiltered): DataTablesResponseInterface { |
||
177 | |||
178 | /** |
||
179 | * {@inheritDoc} |
||
180 | */ |
||
181 | public function setRecordsTotal(int $recordsTotal): DataTablesResponseInterface { |
||
185 | |||
186 | /** |
||
187 | * {@inheritDoc} |
||
188 | */ |
||
189 | public function setRow(string $data, $value): DataTablesResponseInterface { |
||
199 | } |
||
200 |