| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 4 | class Response implements \WebServCo\Framework\Interfaces\JsonInterface |
||
| 5 | { |
||
| 6 | protected $draw; |
||
| 7 | |||
| 8 | protected $recordsTotal; |
||
| 9 | |||
| 10 | protected $recordsFiltered; |
||
| 11 | |||
| 12 | protected $data; |
||
| 13 | |||
| 14 | public function __construct($draw, $recordsTotal, $recordsFiltered, $data = []) |
||
| 20 | } |
||
| 21 | |||
| 22 | public function toArray() |
||
| 23 | { |
||
| 24 | $array = [ |
||
| 25 | 'draw' => $this->draw, |
||
| 26 | 'recordsTotal' => $this->recordsTotal, |
||
| 27 | 'recordsFiltered' => $this->recordsFiltered, |
||
| 28 | 'data' => [] |
||
| 29 | ]; |
||
| 30 | foreach ($this->data as $item) { |
||
| 31 | $array['data'][] = $item; |
||
| 32 | } |
||
| 33 | return $array; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function toJson() |
||
| 40 | } |
||
| 41 | } |
||
| 42 |