1 | <?php |
||
16 | abstract class Provider |
||
17 | { |
||
18 | use ProviderTrait; |
||
19 | |||
20 | /** |
||
21 | * List of methods that require logged status |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $loginRequired = []; |
||
25 | |||
26 | /** |
||
27 | * Instance of the API RequestInterface |
||
28 | * |
||
29 | * @var RequestInterface |
||
30 | */ |
||
31 | protected $request; |
||
32 | |||
33 | /** |
||
34 | * Instance of the API ResponseInterface |
||
35 | * |
||
36 | * @var ResponseInterface |
||
37 | */ |
||
38 | protected $response; |
||
39 | |||
40 | /** |
||
41 | * @param RequestInterface $request |
||
42 | * @param ResponseInterface $response |
||
43 | */ |
||
44 | public function __construct(RequestInterface $request, ResponseInterface $response) |
||
49 | |||
50 | /** |
||
51 | * Executes a POST request to Pinterest API |
||
52 | * |
||
53 | * @param array $requestOptions |
||
54 | * @param string $resourceUrl |
||
55 | * @param bool $returnData |
||
56 | * @return mixed |
||
57 | */ |
||
58 | public function callPostRequest($requestOptions, $resourceUrl, $returnData = false) |
||
70 | |||
71 | /** |
||
72 | * @return Request |
||
73 | */ |
||
74 | public function getRequest() |
||
78 | |||
79 | /** |
||
80 | * @return Response |
||
81 | */ |
||
82 | public function getResponse() |
||
86 | |||
87 | /** |
||
88 | * @param string $method |
||
89 | * @return bool |
||
90 | */ |
||
91 | public function checkMethodRequiresLogin($method) |
||
95 | } |
||
96 |