| 1 | <?php |
||
| 19 | abstract class AbstractResponse implements ResponseInterface |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * The embodied request object |
||
| 23 | * |
||
| 24 | * @var RequestInterface |
||
| 25 | */ |
||
| 26 | protected $request; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * The data contained in the response |
||
| 30 | * |
||
| 31 | * @var mixed |
||
| 32 | */ |
||
| 33 | protected $data; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Constructor |
||
| 37 | * |
||
| 38 | * @param RequestInterface $request the initiating request |
||
| 39 | * @param mixed $data |
||
| 40 | */ |
||
| 41 | 3 | public function __construct(RequestInterface $request, $data) |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Get the initiating request object |
||
| 49 | * |
||
| 50 | * @return RequestInterface |
||
| 51 | */ |
||
| 52 | 3 | public function getRequest() |
|
| 56 | |||
| 57 | /** |
||
| 58 | * Get the response data |
||
| 59 | * |
||
| 60 | * @return mixed |
||
| 61 | */ |
||
| 62 | 6 | public function getData() |
|
| 66 | |||
| 67 | /** |
||
| 68 | * Get response message |
||
| 69 | * |
||
| 70 | * @return null|string A response message from the API |
||
| 71 | */ |
||
| 72 | 3 | public function getMessage() |
|
| 76 | |||
| 77 | /** |
||
| 78 | * Response code |
||
| 79 | * |
||
| 80 | * @return null|string A response code from the API |
||
| 81 | */ |
||
| 82 | 3 | public function getCode() |
|
| 86 | } |
||
| 87 |