-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBeSimpleRosettaBundle.php
53 lines (45 loc) · 1.52 KB
/
BeSimpleRosettaBundle.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 BeSimple\RosettaBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use BeSimple\RosettaBundle\DependencyInjection\Compiler\ScannerPass;
use BeSimple\RosettaBundle\DependencyInjection\Compiler\TranslatorPass;
use BeSimple\RosettaBundle\DependencyInjection\Compiler\ParametersGuesserPass;
use BeSimple\RosettaBundle\DependencyInjection\Compiler\FactoryPass;
use BeSimple\RosettaBundle\DependencyInjection\Compiler\TasksPass;
use Doctrine\DBAL\Types\Type as DoctrineType;
/**
* @author: Jean-François Simon <[email protected]>
*/
class BeSimpleRosettaBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new ScannerPass());
$container->addCompilerPass(new TranslatorPass());
$container->addCompilerPass(new ParametersGuesserPass());
$container->addCompilerPass(new FactoryPass());
$container->addCompilerPass(new TasksPass());
}
/**
* {@inheritdoc}
*/
public function boot()
{
DoctrineType::addType(
'locale',
$this->container->getParameter('be_simple_rosetta.model.locale_type')
);
$this
->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->getDatabasePlatform()
->registerDoctrineTypeMapping('locale', 'locale')
;
}
}