This repository was archived by the owner on May 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlackEmailBundle.php
More file actions
67 lines (57 loc) · 1.92 KB
/
BlackEmailBundle.php
File metadata and controls
67 lines (57 loc) · 1.92 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
namespace Black\Bundle\EmailBundle;
use Black\Bundle\EmailBundle\Application\DependencyInjection\BlackEmailExtension;
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\Console\Application;
/**
* Class BlackEmailBundle
*/
class BlackEmailBundle extends Bundle
{
/**
* @return BlackEmailExtension
*/
public function getContainerExtension()
{
return new BlackEmailExtension();
}
/**
* @param ContainerBuilder $container
*/
public function build(ContainerBuilder $container)
{
parent::build($container);
$mappings = array(
realpath($this->getPath() . '/Resources/config/doctrine/email') => 'Email',
);
$ormCompilerClass = 'Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass';
if (class_exists($ormCompilerClass)) {
$container->addCompilerPass(
DoctrineOrmMappingsPass::createXmlMappingDriver(
$mappings,
[],
'application.backend_type_orm'
));
}
$mongoCompilerClass = 'Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass';
if (class_exists($mongoCompilerClass)) {
$container->addCompilerPass(
DoctrineMongoDBMappingsPass::createXmlMappingDriver(
$mappings,
[],
'application.backend_type_mongodb'
));
}
}
/**
* {@inheritdoc}
*/
public function registerCommands(Application $application)
{
return;
}
}