1 | <?php |
||
20 | class Main |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * Database class instance |
||
25 | * @var \gplcart\core\Database $db |
||
26 | */ |
||
27 | protected $db; |
||
28 | |||
29 | /** |
||
30 | * Library class instance |
||
31 | * @var \gplcart\core\Library $library |
||
32 | */ |
||
33 | protected $library; |
||
34 | |||
35 | /** |
||
36 | * @param Config $config |
||
37 | * @param Library $library |
||
38 | */ |
||
39 | public function __construct(Config $config, Library $library) |
||
45 | |||
46 | /** |
||
47 | * Implements hook "library.list" |
||
48 | * @param array $libraries |
||
49 | */ |
||
50 | public function hookLibraryList(array &$libraries) |
||
68 | |||
69 | /** |
||
70 | * Implements hook "module.enable.after" |
||
71 | */ |
||
72 | public function hookModuleEnableAfter() |
||
76 | |||
77 | /** |
||
78 | * Implements hook "module.disable.after" |
||
79 | */ |
||
80 | public function hookModuleDisableAfter() |
||
84 | |||
85 | /** |
||
86 | * Implements hook "module.install.before" |
||
87 | * @param null|string |
||
88 | */ |
||
89 | public function hookModuleInstallBefore(&$result) |
||
97 | |||
98 | /** |
||
99 | * Implements hook "module.install.after" |
||
100 | */ |
||
101 | public function hookModuleInstallAfter() |
||
105 | |||
106 | /** |
||
107 | * Implements hook "module.uninstall.after" |
||
108 | */ |
||
109 | public function hookModuleUninstallAfter() |
||
114 | |||
115 | /** |
||
116 | * Implements hook "route.list" |
||
117 | * @param mixed $routes |
||
118 | */ |
||
119 | public function hookRouteList(array &$routes) |
||
145 | |||
146 | /** |
||
147 | * Implements hook "user.role.permissions" |
||
148 | * @param array $permissions |
||
149 | */ |
||
150 | public function hookUserRolePermissions(array &$permissions) |
||
157 | |||
158 | /** |
||
159 | * Returns Google API credential |
||
160 | * @param int $id |
||
161 | * @return array |
||
162 | */ |
||
163 | public function getCredential($id) |
||
167 | |||
168 | /** |
||
169 | * Returns an array of existing Google API credentials |
||
170 | * @param array $options |
||
171 | * @return array |
||
172 | */ |
||
173 | public function getCredentials(array $options = array()) |
||
177 | |||
178 | /** |
||
179 | * Returns Google Client object |
||
180 | * @param array $config |
||
181 | * @param null|int $credential_id |
||
182 | * @return \Google_Client |
||
183 | */ |
||
184 | public function getGoogleClient(array $config = array(), $credential_id) |
||
188 | |||
189 | /** |
||
190 | * Returns a Google service class instance |
||
191 | * @param string $service_name |
||
192 | * @param \Google_Client $client |
||
193 | * @return object \Google_Service_SERVICE-NAME |
||
194 | */ |
||
195 | public function getGoogleService($service_name, \Google_Client $client) |
||
199 | |||
200 | /** |
||
201 | * Returns an array of Google service names supported by the library |
||
202 | */ |
||
203 | public function getGoogleServiceNames() |
||
207 | |||
208 | /** |
||
209 | * Returns the Credential model instance |
||
210 | * @return \gplcart\modules\gapi\models\Credential |
||
211 | */ |
||
212 | protected function getCredentialModel() |
||
218 | |||
219 | /** |
||
220 | * Returns the API model instance |
||
221 | * @return \gplcart\modules\gapi\models\Api |
||
222 | */ |
||
223 | protected function getApiModel() |
||
229 | |||
230 | /** |
||
231 | * Returns an array of database scheme |
||
232 | * @return array |
||
233 | */ |
||
234 | protected function getDbScheme() |
||
249 | } |
||
250 |