1 | <?php |
||
10 | class JsonApiResponse extends JsonResponse |
||
11 | { |
||
12 | /** @var int */ |
||
13 | private $code; |
||
14 | |||
15 | /** @var string */ |
||
16 | private $charset; |
||
17 | |||
18 | /** |
||
19 | * @param int $code |
||
20 | * @param array|\stdClass $data |
||
21 | * @param string $contentType |
||
22 | * @param string $charset |
||
23 | */ |
||
24 | 4 | public function __construct($code, $data, $contentType = 'application/json', $charset = 'utf-8') |
|
30 | /** |
||
31 | * Return api response http code |
||
32 | * @return integer |
||
33 | */ |
||
34 | 4 | public function getCode() |
|
38 | /** |
||
39 | * Return encoding charset for http response |
||
40 | * @return string |
||
41 | */ |
||
42 | 2 | public function getCharset() |
|
46 | |||
47 | /** |
||
48 | * @param IRequest $httpRequest |
||
49 | * @param IResponse $httpResponse |
||
50 | */ |
||
51 | public function send(IRequest $httpRequest, IResponse $httpResponse) |
||
60 | } |
||
61 |