| 1 | <?php |
||
| 9 | class XmlApiResponse implements ApplicationIResponse |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var integer |
||
| 13 | */ |
||
| 14 | private $code; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $response = null; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Create XmlApiResponse |
||
| 23 | * This class only wrap JsonResponse from Nette and add possibility |
||
| 24 | * to setup response code and automaticaly set content type |
||
| 25 | * |
||
| 26 | * @param integer $code |
||
| 27 | * @param string $data |
||
| 28 | */ |
||
| 29 | 3 | public function __construct($code, $data) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Return api response http code |
||
| 37 | * |
||
| 38 | * @return integer |
||
| 39 | */ |
||
| 40 | 3 | public function getCode() |
|
| 44 | |||
| 45 | /** |
||
| 46 | * {@inheritdoc} |
||
| 47 | */ |
||
| 48 | 3 | public function send(IRequest $httpRequest, IResponse $httpResponse) |
|
| 56 | } |
||
| 57 |