1 | <?php |
||
16 | class BlackEmailBundle extends Bundle |
||
17 | { |
||
18 | /** |
||
19 | * @return BlackEmailExtension |
||
20 | */ |
||
21 | public function getContainerExtension() |
||
25 | |||
26 | /** |
||
27 | * @param ContainerBuilder $container |
||
28 | */ |
||
29 | public function build(ContainerBuilder $container) |
||
30 | { |
||
31 | parent::build($container); |
||
32 | |||
33 | $mappings = array( |
||
34 | realpath($this->getPath() . '/Resources/config/doctrine/email') => 'Email', |
||
35 | ); |
||
36 | |||
37 | $ormCompilerClass = 'Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass'; |
||
38 | |||
39 | if (class_exists($ormCompilerClass)) { |
||
40 | $container->addCompilerPass( |
||
41 | DoctrineOrmMappingsPass::createXmlMappingDriver( |
||
42 | $mappings, |
||
43 | [], |
||
44 | 'black_email.backend_type_orm' |
||
45 | )); |
||
46 | } |
||
47 | |||
48 | $mongoCompilerClass = 'Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass'; |
||
49 | |||
50 | if (class_exists($mongoCompilerClass)) { |
||
51 | $container->addCompilerPass( |
||
52 | DoctrineMongoDBMappingsPass::createXmlMappingDriver( |
||
53 | $mappings, |
||
54 | [], |
||
55 | 'black_email.backend_type_mongodb' |
||
56 | )); |
||
57 | } |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | public function registerCommands(Application $application) |
||
67 | } |
||
68 |