-
Notifications
You must be signed in to change notification settings - Fork 3
/
ShivasBouncerBundle.php
30 lines (26 loc) · 1.05 KB
/
ShivasBouncerBundle.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
<?php
namespace Shivas\BouncerBundle;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ShivasBouncerBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$modelDir = realpath(__DIR__.'/Resources/config/doctrine/mappings');
$mappings = array(
$modelDir => 'Shivas\BouncerBundle\Model',
);
$ormCompilerClass = 'Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass';
if (class_exists($ormCompilerClass)) {
$container->addCompilerPass(
DoctrineOrmMappingsPass::createXmlMappingDriver(
$mappings,
array('shivas_bouncer.model_manager_name'),
'shivas_bouncer.backend_orm',
array('ShivasBouncerBundle' => 'Shivas\BouncerBundle\Model')
));
}
}
}