|
1
|
|
|
<?php |
|
2
|
|
|
namespace Shivas\BouncerBundle; |
|
3
|
|
|
|
|
4
|
|
|
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass; |
|
5
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
6
|
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle; |
|
7
|
|
|
|
|
8
|
|
|
class ShivasBouncerBundle extends Bundle |
|
9
|
|
|
{ |
|
10
|
|
|
public function build(ContainerBuilder $container) |
|
11
|
|
|
{ |
|
12
|
|
|
parent::build($container); |
|
13
|
|
|
|
|
14
|
|
|
$modelDir = realpath(__DIR__.'/Resources/config/doctrine/mappings'); |
|
15
|
|
|
$mappings = array( |
|
16
|
|
|
$modelDir => 'Shivas\BouncerBundle\Model', |
|
17
|
|
|
); |
|
18
|
|
|
|
|
19
|
|
|
$ormCompilerClass = 'Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass'; |
|
20
|
|
|
if (class_exists($ormCompilerClass)) { |
|
21
|
|
|
$container->addCompilerPass( |
|
22
|
|
|
DoctrineOrmMappingsPass::createXmlMappingDriver( |
|
23
|
|
|
$mappings, |
|
24
|
|
|
array('shivas_bouncer.model_manager_name'), |
|
25
|
|
|
'shivas_bouncer.backend_orm', |
|
26
|
|
|
array('ShivasBouncerBundle' => 'Shivas\BouncerBundle\Model') |
|
27
|
|
|
)); |
|
28
|
|
|
} |
|
29
|
|
|
} |
|
30
|
|
|
} |
|
31
|
|
|
|