1 | <?php |
||
20 | class Api |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * Library class instance |
||
25 | * @var \gplcart\core\Library $library |
||
26 | */ |
||
27 | protected $library; |
||
28 | |||
29 | /** |
||
30 | * Credential model instance |
||
31 | * @var \gplcart\modules\gapi\models\Credential $credential |
||
32 | */ |
||
33 | protected $credential; |
||
34 | |||
35 | /** |
||
36 | * @param Library $library |
||
37 | * @param ModuleGapiCredentialModel $credential |
||
38 | */ |
||
39 | public function __construct(Library $library, ModuleGapiCredentialModel $credential) |
||
44 | |||
45 | /** |
||
46 | * Returns Google Client object |
||
47 | * @param array $config |
||
48 | * @param null|int $credential_id |
||
49 | * @return \Google_Client |
||
50 | * @throws RuntimeException |
||
51 | * @throws OutOfRangeException |
||
52 | */ |
||
53 | public function getClient(array $config = array(), $credential_id = null) |
||
93 | |||
94 | /** |
||
95 | * Returns a Google service class instance |
||
96 | * @param string $service_name |
||
97 | * @param \Google_Client $client |
||
98 | * @return object |
||
99 | * @throws RuntimeException |
||
100 | */ |
||
101 | public function getService($service_name, \Google_Client $client) |
||
113 | |||
114 | /** |
||
115 | * Returns an array of Google service names supported by the library |
||
116 | * @return array |
||
117 | * @throws RuntimeException |
||
118 | */ |
||
119 | public function getServiceNames() |
||
141 | } |
||
142 |