-
Notifications
You must be signed in to change notification settings - Fork 2
/
C2isSocialWallBundle.php
37 lines (32 loc) · 1.31 KB
/
C2isSocialWallBundle.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
<?php
namespace C2is\Bundle\SocialWallBundle;
use C2is\Bundle\SocialWallBundle\DependencyInjection\Compiler\ResolveDoctrineTargetEntitiesPass;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Class C2isSocialWallBundle
*
* @package C2is\Bundle\SocialWallBundle
*/
class C2isSocialWallBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
$modelDir = realpath(__DIR__.'/Resources/config/doctrine/model');
$mappings = array(
$modelDir => 'C2is\Bundle\SocialWallBundle\Model',
);
$ormCompilerClass = 'Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass';
if (class_exists($ormCompilerClass)) {
$container->addCompilerPass(
DoctrineOrmMappingsPass::createYamlMappingDriver(
$mappings,
array('c2is_social_wall.model_manager_name'),
'c2is_social_wall.persistence_type_orm',
array('C2isSocialWallBundle' => 'C2is\Bundle\SocialWallBundle\Model')
));
}
$container->addCompilerPass(new ResolveDoctrineTargetEntitiesPass());
}
}