1 | <?php |
||
7 | class TextApiResponse extends TextResponse |
||
8 | { |
||
9 | /** |
||
10 | * @var integer |
||
11 | */ |
||
12 | private $code; |
||
13 | |||
14 | /** |
||
15 | * Create TextApiResponse |
||
16 | * This class only wrap JsonResponse from Nette and add possibility |
||
17 | * to setup response code and automaticaly set content type |
||
18 | * |
||
19 | * @param integer $code |
||
20 | * @param mixed $data |
||
21 | */ |
||
22 | public function __construct($code, $data) |
||
27 | |||
28 | /** |
||
29 | * Return api response http code |
||
30 | * |
||
31 | * @return integer |
||
32 | */ |
||
33 | public function getCode() |
||
37 | } |
||
38 |