forked from fsi-open/news-bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FSiNewsBundle.php
51 lines (44 loc) · 1.27 KB
/
FSiNewsBundle.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
<?php
/**
* (c) FSi sp. z o.o. <info@fsi.pl>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FSi\Bundle\NewsBundle;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
use FSi\Bundle\NewsBundle\DependencyInjection\FSINewsExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class FSiNewsBundle extends Bundle
{
/**
* @param ContainerBuilder $container
*/
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(DoctrineOrmMappingsPass::createXmlMappingDriver(
$this->getDoctrineMappings(),
array('doctrine.orm.entity_manager'))
);
}
/**
* @return FSINewsExtension
*/
public function getContainerExtension()
{
if (null === $this->extension) {
$this->extension = new FSINewsExtension();
}
return $this->extension;
}
/**
* @return array
*/
private function getDoctrineMappings()
{
return array(
realpath(__DIR__ . '/Resources/config/doctrine/model') => 'FSi\Bundle\NewsBundle\Model',
);
}
}