1 | <?php |
||
11 | class RepositoryResponse |
||
12 | { |
||
13 | const STATUS_SUCCESS = 'OK'; |
||
14 | |||
15 | /** @var bool */ |
||
16 | protected $successful = false; |
||
17 | |||
18 | /** @var string */ |
||
19 | protected $response; |
||
20 | |||
21 | /** @var Error */ |
||
22 | protected $error; |
||
23 | |||
24 | /** |
||
25 | * @return string |
||
26 | */ |
||
27 | public function getResponse() |
||
31 | |||
32 | /** |
||
33 | * @return array |
||
34 | */ |
||
35 | public function getResponseAsArray() |
||
39 | |||
40 | /** |
||
41 | * @param mixed $response |
||
42 | */ |
||
43 | public function setResponse($response) |
||
47 | |||
48 | /** |
||
49 | * @return boolean |
||
50 | */ |
||
51 | public function isSuccessful() |
||
55 | |||
56 | /** |
||
57 | * @param boolean $successful |
||
58 | */ |
||
59 | public function setSuccessful($successful) |
||
63 | |||
64 | /** |
||
65 | * @return Error |
||
66 | */ |
||
67 | public function getError() |
||
71 | |||
72 | /** |
||
73 | * @param Error $error |
||
74 | */ |
||
75 | public function setError(Error $error) |
||
79 | |||
80 | |||
81 | /** |
||
82 | * @param Response $response |
||
83 | * |
||
84 | * @return RepositoryResponse |
||
85 | */ |
||
86 | public static function fromResponse(Response $response) |
||
111 | |||
112 | /** |
||
113 | * @param Response $response |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | private static function getResponseContent(Response $response) |
||
125 | } |
||
126 |