1 | <?php |
||
28 | abstract class AbstractProvider { |
||
29 | |||
30 | /** |
||
31 | * Endpoint path. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | const ENDPOINT_PATH = "https://api.pexels.com"; |
||
36 | |||
37 | /** |
||
38 | * Debug. |
||
39 | * |
||
40 | * @var bool |
||
41 | */ |
||
42 | private $debug; |
||
43 | |||
44 | /** |
||
45 | * Constructor. |
||
46 | */ |
||
47 | public function __construct() { |
||
50 | |||
51 | /** |
||
52 | * Build a resource path. |
||
53 | * |
||
54 | * @param AbstractRequest $request The request. |
||
55 | * @return string Returns the resource path. |
||
56 | * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. |
||
57 | */ |
||
58 | private function buildResourcePath(AbstractRequest $request) { |
||
70 | |||
71 | /** |
||
72 | * Call the API. |
||
73 | * |
||
74 | * @param AbstractRequest $request The request. |
||
75 | * @param array $queryData The query data. |
||
76 | * @return string Returns the raw response. |
||
77 | * @throws APIException Throws an API exception if an error occurs. |
||
78 | */ |
||
79 | protected function callAPI(AbstractRequest $request, array $queryData) { |
||
110 | |||
111 | /** |
||
112 | * Get the debug. |
||
113 | * |
||
114 | * @return bool Returns the debug. |
||
115 | */ |
||
116 | public function getDebug() { |
||
119 | |||
120 | /** |
||
121 | * Set the debug. |
||
122 | * |
||
123 | * @param bool $debug The debug. |
||
124 | * @return AbstractProvider Returns this provider. |
||
125 | */ |
||
126 | public function setDebug($debug) { |
||
130 | } |
||
131 |