1 | <?php |
||
24 | final class DataTablesResponse implements JsonSerializable { |
||
25 | |||
26 | /** |
||
27 | * Data. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | private $data; |
||
32 | |||
33 | /** |
||
34 | * Draw. |
||
35 | * |
||
36 | * @var integer |
||
37 | */ |
||
38 | private $draw; |
||
39 | |||
40 | /** |
||
41 | * Error. |
||
42 | * |
||
43 | * @var string |
||
44 | */ |
||
45 | private $error; |
||
46 | |||
47 | /** |
||
48 | * Records filtered. |
||
49 | * |
||
50 | * @var integer |
||
51 | */ |
||
52 | private $recordsFiltered; |
||
53 | |||
54 | /** |
||
55 | * Records total. |
||
56 | * |
||
57 | * @var integer |
||
58 | */ |
||
59 | private $recordsTotal; |
||
60 | |||
61 | /** |
||
62 | * Constructor. |
||
63 | */ |
||
64 | private function __construct() { |
||
70 | |||
71 | /** |
||
72 | * Get the data. |
||
73 | * |
||
74 | * @return array Returns the data. |
||
75 | */ |
||
76 | public function getData() { |
||
79 | |||
80 | /** |
||
81 | * Get the draw |
||
82 | * |
||
83 | * @return integer Returns the draw. |
||
84 | */ |
||
85 | public function getDraw() { |
||
88 | |||
89 | /** |
||
90 | * Get the error. |
||
91 | * |
||
92 | * @return string Returns the error. |
||
93 | */ |
||
94 | public function getError() { |
||
97 | |||
98 | /** |
||
99 | * Get the records filtered. |
||
100 | * |
||
101 | * @return integer The records filtered. |
||
102 | */ |
||
103 | public function getRecordsFiltered() { |
||
106 | |||
107 | /** |
||
108 | * Get the records total. |
||
109 | * |
||
110 | * @return integer Returns the records total. |
||
111 | */ |
||
112 | public function getRecordsTotal() { |
||
115 | |||
116 | /** |
||
117 | * {@inheritdoc} |
||
118 | */ |
||
119 | public function jsonSerialize() { |
||
122 | |||
123 | /** |
||
124 | * Create a DataTables response. |
||
125 | * |
||
126 | * @param DataTablesRequest $dtRequest The DataTables request. |
||
127 | * @return DataTablesResponse Returns a DataTables response. |
||
128 | */ |
||
129 | public static function newInstance(DataTablesRequest $dtRequest) { |
||
140 | |||
141 | /** |
||
142 | * Set the draw. |
||
143 | * |
||
144 | * @param integer $draw The draw. |
||
145 | * @return DataTablesResponse Returns the DataTables response. |
||
146 | */ |
||
147 | private function setDraw($draw) { |
||
151 | |||
152 | /** |
||
153 | * Set the data. |
||
154 | * |
||
155 | * @param array $data The data. |
||
156 | * @return DataTablesResponse Returns the DataTables response. |
||
157 | */ |
||
158 | private function setData(array $data) { |
||
162 | |||
163 | /** |
||
164 | * Set the error. |
||
165 | * |
||
166 | * @param string $error The error. |
||
167 | * @return DataTablesResponse Returns the DataTables response. |
||
168 | */ |
||
169 | public function setError($error) { |
||
173 | |||
174 | /** |
||
175 | * Set the records filtered. |
||
176 | * |
||
177 | * @param integer $recordsFiltered The records filtered. |
||
178 | * @return DataTablesResponse Returns the DataTables response. |
||
179 | */ |
||
180 | public function setRecordsFiltered($recordsFiltered) { |
||
184 | |||
185 | /** |
||
186 | * Set the records total. |
||
187 | * |
||
188 | * @param integer $recordsTotal The records total. |
||
189 | * @return DataTablesResponse Returns the DataTables response. |
||
190 | */ |
||
191 | public function setRecordsTotal($recordsTotal) { |
||
195 | |||
196 | /** |
||
197 | * Convert into an array representing this instance. |
||
198 | * |
||
199 | * @return array Returns an array representing this instance. |
||
200 | */ |
||
201 | public function toArray() { |
||
214 | |||
215 | } |
||
216 |