1 | <?php |
||
18 | class Module |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Database class instance |
||
23 | * @var \gplcart\core\Database $db |
||
24 | */ |
||
25 | protected $db; |
||
26 | |||
27 | /** |
||
28 | * @param Config $config |
||
29 | */ |
||
30 | public function __construct(Config $config) |
||
35 | |||
36 | /** |
||
37 | * Implements hook "module.install.before" |
||
38 | * @param null|string $result |
||
39 | */ |
||
40 | public function hookModuleInstallBefore(&$result) |
||
53 | |||
54 | /** |
||
55 | * Implements hook "module.uninstall.after" |
||
56 | */ |
||
57 | public function hookModuleUninstallAfter() |
||
61 | |||
62 | /** |
||
63 | * Implements hook "user.role.permissions" |
||
64 | * @param array $permissions |
||
65 | */ |
||
66 | public function hookUserRolePermissions(array &$permissions) |
||
72 | |||
73 | /** |
||
74 | * Implements hook "route.list" |
||
75 | * @param array $routes |
||
76 | */ |
||
77 | public function hookRouteList(array &$routes) |
||
87 | |||
88 | /** |
||
89 | * Performs backup operation |
||
90 | * @param string $handler_id |
||
91 | * @param array $data |
||
92 | * @return boolean|string |
||
93 | */ |
||
94 | public function backup($handler_id, array $data) |
||
98 | |||
99 | /** |
||
100 | * Performs restore operation |
||
101 | * @param string $handler_id |
||
102 | * @param array $data |
||
103 | * @return boolean|string |
||
104 | */ |
||
105 | public function restore($handler_id, array $data) |
||
109 | |||
110 | /** |
||
111 | * Returns an array of defined handlers |
||
112 | * @return array |
||
113 | */ |
||
114 | public function getHandlers() |
||
118 | |||
119 | /** |
||
120 | * Whether a backup already exists |
||
121 | * @param string $id |
||
122 | * @param null|string $version |
||
123 | * @return bool |
||
124 | */ |
||
125 | public function exists($id, $version = null) |
||
129 | |||
130 | /** |
||
131 | * Returns backup model |
||
132 | * @return \gplcart\modules\backup\models\Backup |
||
133 | */ |
||
134 | protected function getModel() |
||
138 | |||
139 | /** |
||
140 | * Translation UI model instance |
||
141 | * @return \gplcart\core\models\Translation |
||
142 | */ |
||
143 | protected function getTranslationModel() |
||
147 | |||
148 | /** |
||
149 | * Returns an array of database scheme |
||
150 | * @return array |
||
151 | */ |
||
152 | protected function getDbScheme() |
||
169 | |||
170 | } |
||
171 |