-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMultiTenantBundle.php
More file actions
31 lines (25 loc) · 953 Bytes
/
MultiTenantBundle.php
File metadata and controls
31 lines (25 loc) · 953 Bytes
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
<?php
namespace Cvele\MultiTenantBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
class MultiTenantBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$this->addRegisterMappingsPass($container);
}
/**
* @param ContainerBuilder $container
*/
private function addRegisterMappingsPass(ContainerBuilder $container)
{
$mappings = array(
realpath(__DIR__ . '/Resources/config/doctrine-mapping') => 'Cvele\MultiTenantBundle\Model',
);
if (class_exists('Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass')) {
$container->addCompilerPass(DoctrineOrmMappingsPass::createXmlMappingDriver($mappings));
}
}
}