|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Bankiru\Doctrine\DiType; |
|
4
|
|
|
|
|
5
|
|
|
use Bankiru\Doctrine\DiType\DependencyInjection\BankiruDoctrineDiTypeExtension; |
|
6
|
|
|
use Bankiru\Doctrine\DiType\DependencyInjection\Compiler\DiTypesConfiguratorPass; |
|
7
|
|
|
use Symfony\Component\DependencyInjection\Compiler\PassConfig; |
|
8
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
9
|
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle; |
|
10
|
|
|
|
|
11
|
|
|
final class BankiruDoctrineDiTypeBundle extends Bundle |
|
12
|
|
|
{ |
|
13
|
|
|
public function boot() |
|
14
|
|
|
{ |
|
15
|
|
|
parent::boot(); |
|
16
|
|
|
|
|
17
|
|
|
if (!$this->container->has('bankiru_doctrine_di_types.type_factory')) { |
|
18
|
|
|
return; |
|
19
|
|
|
} |
|
20
|
|
|
|
|
21
|
|
|
if ($this->container->getParameter('bankiru_doctrine_di_types.force_fetch_on_boot')) { |
|
22
|
|
|
$this->container->get( |
|
23
|
|
|
$this->container->getParameter('bankiru_doctrine_di_types.init_service') |
|
24
|
|
|
); |
|
25
|
|
|
} |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
public function build(ContainerBuilder $container) |
|
29
|
|
|
{ |
|
30
|
|
|
parent::build($container); |
|
31
|
|
|
|
|
32
|
|
|
$container->addCompilerPass(new DiTypesConfiguratorPass(), PassConfig::TYPE_BEFORE_REMOVING); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
public function getContainerExtension() |
|
36
|
|
|
{ |
|
37
|
|
|
return new BankiruDoctrineDiTypeExtension(); |
|
38
|
|
|
} |
|
39
|
|
|
} |
|
40
|
|
|
|