1 | <?php |
||
22 | class Api |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * Library class instance |
||
27 | * @var \gplcart\core\Library $library |
||
28 | */ |
||
29 | protected $library; |
||
30 | |||
31 | /** |
||
32 | * Credential model instance |
||
33 | * @var \gplcart\modules\gapi\models\Credential $credential |
||
34 | */ |
||
35 | protected $credential; |
||
36 | |||
37 | /** |
||
38 | * @param Library $library |
||
39 | * @param ModuleGapiCredentialModel $credential |
||
40 | */ |
||
41 | public function __construct(Library $library, ModuleGapiCredentialModel $credential) |
||
46 | |||
47 | /** |
||
48 | * Returns Google Client object |
||
49 | * @param null|int $credential_id |
||
50 | * @param bool $use_own_certificate |
||
51 | * @return \Google_Client |
||
52 | * @throws LogicException |
||
53 | * @throws OutOfBoundsException |
||
54 | */ |
||
55 | public function getClient($credential_id = null, $use_own_certificate = true) |
||
84 | |||
85 | /** |
||
86 | * Returns a Google service class instance |
||
87 | * @param string $service_name |
||
88 | * @param \Google_Client $client |
||
89 | * @return object |
||
90 | * @throws LogicException |
||
91 | */ |
||
92 | public function getService($service_name, \Google_Client $client) |
||
104 | |||
105 | /** |
||
106 | * Returns an array of Google service names supported by the library |
||
107 | * @return array |
||
108 | * @throws RuntimeException |
||
109 | */ |
||
110 | public function getServiceNames() |
||
132 | } |
||
133 |