1 | <?php |
||
34 | abstract class AbstractModule |
||
35 | { |
||
36 | |||
37 | /** |
||
38 | * @var string Module name |
||
39 | */ |
||
40 | private $moduleName; |
||
41 | |||
42 | /** |
||
43 | * @var string Module version |
||
44 | */ |
||
45 | private $version; |
||
46 | |||
47 | /** |
||
48 | * @var \Tight\TightConfig Application settings |
||
49 | */ |
||
50 | private $appConfig; |
||
51 | |||
52 | /** |
||
53 | * @var \Tight\BaseConfig Module configuration |
||
54 | */ |
||
55 | private $moduleConfig; |
||
56 | |||
57 | public function __construct($name, $version = "v1.0") { |
||
63 | |||
64 | public function getModuleVersion() { |
||
67 | |||
68 | /** |
||
69 | * Gets the module name |
||
70 | * @return string Module name |
||
71 | */ |
||
72 | public function getModuleName() { |
||
75 | |||
76 | /** |
||
77 | * Sets the module configuration |
||
78 | * @param \Tight\BaseConfig $conf Configuration |
||
79 | * @return \Tight\Modules\AbstractModule Fluent setter |
||
80 | */ |
||
81 | public function setConfig(\Tight\BaseConfig $conf) { |
||
86 | |||
87 | /** |
||
88 | * Gets the module configuration |
||
89 | * @return \Tight\BaseConfig Config |
||
90 | */ |
||
91 | public function getConfig() { |
||
94 | |||
95 | /** |
||
96 | * Gets the application configuration |
||
97 | * @return \Tight\TightConfig Tight app config |
||
98 | */ |
||
99 | public function getAppConfig() { |
||
102 | |||
103 | abstract public function onConfigChange(); |
||
104 | |||
105 | abstract public function onLoad(); |
||
106 | |||
107 | abstract public function onRemove(); |
||
108 | } |
||
109 |