1 | <?php |
||
19 | class Main |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * Database class instance |
||
24 | * @var \gplcart\core\Database $db |
||
25 | */ |
||
26 | protected $db; |
||
27 | |||
28 | /** |
||
29 | * @param Config $config |
||
30 | */ |
||
31 | public function __construct(Config $config) |
||
36 | |||
37 | /** |
||
38 | * Implements hook "library.list" |
||
39 | * @param array $libraries |
||
40 | */ |
||
41 | public function hookLibraryList(array &$libraries) |
||
54 | |||
55 | /** |
||
56 | * Implements hook "module.install.before" |
||
57 | * @param null|string |
||
58 | */ |
||
59 | public function hookModuleInstallBefore(&$result) |
||
67 | |||
68 | /** |
||
69 | * Implements hook "module.uninstall.after" |
||
70 | */ |
||
71 | public function hookModuleUninstallAfter() |
||
75 | |||
76 | /** |
||
77 | * Implements hook "route.list" |
||
78 | * @param mixed $routes |
||
79 | */ |
||
80 | public function hookRouteList(array &$routes) |
||
106 | |||
107 | /** |
||
108 | * Implements hook "user.role.permissions" |
||
109 | * @param array $permissions |
||
110 | */ |
||
111 | public function hookUserRolePermissions(array &$permissions) |
||
118 | |||
119 | /** |
||
120 | * Returns Google API credential |
||
121 | * @param int $id |
||
122 | * @return array |
||
123 | */ |
||
124 | public function getCredential($id) |
||
128 | |||
129 | /** |
||
130 | * Returns an array of existing Google API credentials |
||
131 | * @param array $options |
||
132 | * @return array |
||
133 | */ |
||
134 | public function getCredentials(array $options = array()) |
||
138 | |||
139 | /** |
||
140 | * Returns Google Client object |
||
141 | * @param null|int $credential_id |
||
142 | * @param bool $use_own_certificate |
||
143 | * @return \Google_Client |
||
144 | */ |
||
145 | public function getGoogleClient($credential_id = null, $use_own_certificate = true) |
||
149 | |||
150 | /** |
||
151 | * Returns a Google service class instance |
||
152 | * @param string $service_name |
||
153 | * @param \Google_Client $client |
||
154 | * @return object \Google_Service_SERVICE-NAME |
||
155 | */ |
||
156 | public function getGoogleService($service_name, \Google_Client $client) |
||
160 | |||
161 | /** |
||
162 | * Returns an array of Google service names supported by the library |
||
163 | */ |
||
164 | public function getGoogleServiceNames() |
||
168 | |||
169 | /** |
||
170 | * Returns the Credential model instance |
||
171 | * @return \gplcart\modules\gapi\models\Credential |
||
172 | */ |
||
173 | protected function getCredentialModel() |
||
179 | |||
180 | /** |
||
181 | * Returns the API model instance |
||
182 | * @return \gplcart\modules\gapi\models\Api |
||
183 | */ |
||
184 | protected function getApiModel() |
||
190 | |||
191 | /** |
||
192 | * Returns an array of database scheme |
||
193 | * @return array |
||
194 | */ |
||
195 | protected function getDbScheme() |
||
210 | } |
||
211 |