-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAbstractBundle.php
38 lines (34 loc) · 921 Bytes
/
AbstractBundle.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
<?php
namespace Ekyna\Bundle\CoreBundle;
use Ekyna\Bundle\CoreBundle\DependencyInjection\Compiler\ResolveDoctrineTargetEntitiesPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Class AbstractBundle
* @package Ekyna\Bundle\CoreBundle
* @author Étienne Dauvergne <contact@ekyna.com>
*/
abstract class AbstractBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
{
$interfaces = $this->getModelInterfaces();
if (!empty($interfaces)) {
$container->addCompilerPass(
new ResolveDoctrineTargetEntitiesPass($interfaces)
);
}
}
/**
* Target entities resolver configuration (Interface - Model).
*
* @return array
*/
protected function getModelInterfaces()
{
return [];
}
}