| 1 | <?php |
||
| 20 | abstract class AbstractApi |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | protected $endpoint = 'https://api.vultr.com/v1'; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var AdapterInterface |
||
| 29 | */ |
||
| 30 | protected $adapter; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var Meta |
||
| 34 | */ |
||
| 35 | protected $meta; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param AdapterInterface $adapter |
||
| 39 | */ |
||
| 40 | public function __construct(AdapterInterface $adapter) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Bind response to Entity. |
||
| 47 | * |
||
| 48 | * Decode API response and bind the response to the respective entity |
||
| 49 | * |
||
| 50 | * @param string $response the response from the API |
||
| 51 | * @param string $class Entity to bind the response to |
||
| 52 | * @param bool $isArray If the response is a collection |
||
| 53 | * |
||
| 54 | * @return object Entity instance |
||
| 55 | **/ |
||
| 56 | protected function handleResponse($response, $class, $isArray = false) |
||
| 67 | } |
||
| 68 |