1 | <?php |
||
45 | abstract class ModuleAbstract |
||
46 | { |
||
47 | /** |
||
48 | * @access protected |
||
49 | * @var Framework |
||
50 | */ |
||
51 | protected $framework; |
||
52 | |||
53 | /** |
||
54 | * @access protected |
||
55 | * @var string |
||
56 | */ |
||
57 | protected $namespace; |
||
58 | |||
59 | /** |
||
60 | * @access protected |
||
61 | * @var string |
||
62 | */ |
||
63 | protected $directory; |
||
64 | |||
65 | /** |
||
66 | * Constructs the object |
||
67 | * |
||
68 | * @access public |
||
69 | * @param \Zepi\Turbo\Framework $framework |
||
70 | * @param string $namespace |
||
71 | * @param string $directory |
||
72 | */ |
||
73 | 12 | public function __construct(Framework $framework, $namespace, $directory) |
|
79 | |||
80 | /** |
||
81 | * Initializes the module |
||
82 | * |
||
83 | * @access public |
||
84 | */ |
||
85 | public function initialize() |
||
89 | |||
90 | /** |
||
91 | * Initializes and return an instance of the given class name. |
||
92 | * |
||
93 | * @access public |
||
94 | * @param string $className |
||
95 | * @return mixed |
||
96 | */ |
||
97 | public function getInstance($className) |
||
101 | |||
102 | /** |
||
103 | * This action will be executed on the activation of the module |
||
104 | * |
||
105 | * @access public |
||
106 | * @abstract |
||
107 | * @param string $versionNumber |
||
108 | * @param string $oldVersionNumber |
||
109 | */ |
||
110 | abstract public function activate($versionNumber, $oldVersionNumber = ''); |
||
111 | |||
112 | /** |
||
113 | * This action will be executed on the deactiviation of the module |
||
114 | * |
||
115 | * @access public |
||
116 | */ |
||
117 | public function deactivate() |
||
121 | |||
122 | /** |
||
123 | * Returns the namespace of the module |
||
124 | * |
||
125 | * @access public |
||
126 | * @return string |
||
127 | */ |
||
128 | 4 | public function getNamespace() |
|
132 | |||
133 | /** |
||
134 | * Returns the directory of the module |
||
135 | * |
||
136 | * @access public |
||
137 | * @return string |
||
138 | */ |
||
139 | 4 | public function getDirectory() |
|
143 | } |
||
144 |