forked from bankiru/doctrine-di-types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BankiruDoctrineDiTypeBundle.php
39 lines (31 loc) · 1.14 KB
/
BankiruDoctrineDiTypeBundle.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
<?php
namespace Bankiru\Doctrine\DiType;
use Bankiru\Doctrine\DiType\DependencyInjection\BankiruDoctrineDiTypeExtension;
use Bankiru\Doctrine\DiType\DependencyInjection\Compiler\DiTypesConfiguratorPass;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
final class BankiruDoctrineDiTypeBundle extends Bundle
{
public function boot()
{
parent::boot();
if (!$this->container->has('bankiru_doctrine_di_types.type_factory')) {
return;
}
if ($this->container->getParameter('bankiru_doctrine_di_types.force_fetch_on_boot')) {
$this->container->get(
$this->container->getParameter('bankiru_doctrine_di_types.init_service')
);
}
}
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new DiTypesConfiguratorPass(), PassConfig::TYPE_BEFORE_REMOVING);
}
public function getContainerExtension()
{
return new BankiruDoctrineDiTypeExtension();
}
}