/
ZikulaModule.php
46 lines (34 loc) · 1.05 KB
/
ZikulaModule.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace Zikula\ModuleBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
*
*/
abstract class ZikulaModule extends \Symfony\Component\HttpKernel\Bundle\Bundle {
private $serviceIds = array();
public function __construct() {
$name = get_class($this);
$posNamespaceSeperator = strrpos($name, '\\');
$this->name = substr($name, $posNamespaceSeperator + 1);
}
public abstract function getVersion();
/**
* @return ModuleInstallerInterface
*/
public abstract function createInstaller();
final public function build(ContainerBuilder $container)
{
// modules have to use DI Extensions
}
final public function getContainerExtension()
{
$ex = parent::getContainerExtension();
if($ex != null) {
$ex = new DependencyInjection\SandboxContainerExtension($ex, $this->serviceIds);
}
return $ex;
}
public function getServiceIds() {
return $this->serviceIds;
}
}