1 | <?php |
||
30 | class InstagramResponse |
||
31 | { |
||
32 | /** @var int $status_code */ |
||
33 | protected $statusCode; |
||
34 | |||
35 | /** @var string $protocol */ |
||
36 | protected $protocol = '1.1'; |
||
37 | |||
38 | /** @var array $headers */ |
||
39 | protected $headers = []; |
||
40 | |||
41 | /** @var bool */ |
||
42 | protected $isPagination = false; |
||
43 | |||
44 | /** @var object */ |
||
45 | protected $pagination; |
||
46 | |||
47 | /** @var bool */ |
||
48 | protected $isMetaData = false; |
||
49 | |||
50 | /** @var object */ |
||
51 | protected $metaData; |
||
52 | |||
53 | /** @var object */ |
||
54 | protected $data; |
||
55 | |||
56 | /** @var object $body */ |
||
57 | protected $body; |
||
58 | |||
59 | /** |
||
60 | * InstagramResponse Entity |
||
61 | * |
||
62 | * @param Response $response |
||
63 | * |
||
64 | * @throws InstagramResponseException |
||
65 | */ |
||
66 | public function __construct(Response $response) |
||
73 | |||
74 | /** |
||
75 | * Set Values to the class members |
||
76 | * |
||
77 | * @param Response $response |
||
78 | */ |
||
79 | private function setParams(Response $response) |
||
87 | |||
88 | /** |
||
89 | * Extract Body Parts from the response |
||
90 | */ |
||
91 | private function extractBodyParts() |
||
105 | |||
106 | /** |
||
107 | * Get response |
||
108 | * |
||
109 | * @return object|string |
||
110 | */ |
||
111 | public function getBody() |
||
115 | |||
116 | /** |
||
117 | * Get Status Code |
||
118 | * |
||
119 | * @return int |
||
120 | */ |
||
121 | public function getStatusCode() |
||
125 | |||
126 | /** |
||
127 | * Get specific header |
||
128 | * |
||
129 | * @param string $header |
||
130 | * |
||
131 | * @retrun string |
||
132 | */ |
||
133 | public function getHeader($header) |
||
137 | |||
138 | /** |
||
139 | * Get all headers |
||
140 | * |
||
141 | * @retrun array |
||
142 | */ |
||
143 | public function getHeaders() |
||
147 | |||
148 | /** |
||
149 | * Get data from body |
||
150 | * |
||
151 | * @return object |
||
152 | */ |
||
153 | public function getData() |
||
157 | |||
158 | /** |
||
159 | * Get Meta data |
||
160 | * |
||
161 | * @return object |
||
162 | */ |
||
163 | public function getMetaData() |
||
167 | |||
168 | /** |
||
169 | * Get Meta data |
||
170 | * |
||
171 | * @return object |
||
172 | */ |
||
173 | public function getPagination() |
||
177 | |||
178 | /** |
||
179 | * Is Meta Data Present |
||
180 | * |
||
181 | * @return bool |
||
182 | */ |
||
183 | public function isMetaDataSet() |
||
187 | |||
188 | /** |
||
189 | * Is Pagination present |
||
190 | * |
||
191 | * @return bool |
||
192 | */ |
||
193 | public function isPaginationSet() |
||
197 | |||
198 | /** |
||
199 | * Get Protocol version |
||
200 | * |
||
201 | * @return string |
||
202 | */ |
||
203 | public function getProtocol() |
||
207 | } |
||
208 |