-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathTSSAutomailerBundle.php
executable file
·53 lines (49 loc) · 2.13 KB
/
TSSAutomailerBundle.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
47
48
49
50
51
52
53
<?php
namespace TSS\AutomailerBundle;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class TSSAutomailerBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
if (class_exists('Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass')) {
$container->addCompilerPass(
DoctrineOrmMappingsPass::createXmlMappingDriver(
[__DIR__.'/Resources/config/doctrine/orm' => __NAMESPACE__.'\\Model'],
[],
false
)
);
$container->addCompilerPass(
DoctrineOrmMappingsPass::createAnnotationMappingDriver(
[__NAMESPACE__.'\\DefaultEntity'],
[__DIR__.DIRECTORY_SEPARATOR.'DefaultEntity'],
[],
'tss_automailer.disable_default_entity',
['TSSAutomailerBundle' => 'TSS\AutomailerBundle\DefaultEntity']
)
);
}
if (class_exists('Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass')) {
$container->addCompilerPass(
DoctrineMongoDBMappingsPass::createXmlMappingDriver(
[__DIR__.'/Resources/config/doctrine/odm' => __NAMESPACE__.'\\Model'],
[],
false
)
);
$container->addCompilerPass(
DoctrineMongoDBMappingsPass::createAnnotationMappingDriver(
[__NAMESPACE__.'\\DefaultDocument'],
[__DIR__.DIRECTORY_SEPARATOR.'DefaultDocument'],
[],
'tss_automailer.disable_default_document',
['TSSAutomailerBundle' => 'TSS\AutomailerBundle\DefaultDocument']
)
);
}
}
}