1 | <?php |
||
14 | class AbstractResource |
||
15 | { |
||
16 | /** |
||
17 | * The API client. |
||
18 | * |
||
19 | * @var Client |
||
20 | */ |
||
21 | protected $client; |
||
22 | |||
23 | /** |
||
24 | * Serializer interface to serialize / deserialize the request / responses. |
||
25 | * |
||
26 | * @var SerializerInterface |
||
27 | */ |
||
28 | protected $serializer; |
||
29 | |||
30 | /** |
||
31 | * Constructor. |
||
32 | * |
||
33 | * @param Client $client The API client. |
||
34 | * @param SerializerInterface $serializer Serializer interface to serialize / deserialize the request / responses. |
||
35 | */ |
||
36 | public function __construct(Client $client, SerializerInterface $serializer) |
||
41 | |||
42 | /** |
||
43 | * Create an ApiException from a client exception. |
||
44 | * |
||
45 | * @param ClientException $e The client exception. |
||
46 | * @return ApiException |
||
47 | */ |
||
48 | protected function createApiException(ClientException $e) |
||
71 | } |
||
72 |