Completed
Push — master ( 9b9eb1...4c3adc )
by Beñat
13:24
created

Lin3sSharedKernelBundle::build()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 27
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 27
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 19
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the CMS Kernel package.
5
 *
6
 * Copyright (c) 2016-present LIN3S <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace LIN3S\SharedKernel\Infrastructure\Symfony\Bundle;
13
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\HttpKernel\Bundle\Bundle;
16
17
/**
18
 * @author Beñat Espiña <[email protected]>
19
 */
20
class Lin3sSharedKernelBundle extends Bundle
21
{
22
    public function build(ContainerBuilder $container)
23
    {
24
        $container->loadFromExtension('doctrine', [
25
            'orm' => [
26
                'mappings' => [
27
                    'Lin3sSharedKernelEmail' => [
28
                        'type'      => 'xml',
29
                        'is_bundle' => false,
30
                        'dir'       => $this->basePath() . '/Email/Mapping/',
31
                        'prefix'    => 'LIN3S\SharedKernel\Domain\Model\Email',
32
                    ],
33
                    'Lin3sSharedKernelSlug'  => [
34
                        'type'      => 'xml',
35
                        'is_bundle' => false,
36
                        'dir'       => $this->basePath() . '/Slug/Mapping/',
37
                        'prefix'    => 'LIN3S\SharedKernel\Domain\Model\Slug',
38
                    ],
39
                    'Lin3sSharedKernelPhone' => [
40
                        'type'      => 'xml',
41
                        'is_bundle' => false,
42
                        'dir'       => $this->basePath() . '/Phone/Mapping/',
43
                        'prefix'    => 'LIN3S\SharedKernel\Domain\Model\Phone',
44
                    ],
45
                ],
46
            ],
47
        ]);
48
    }
49
50
    private function basePath()
51
    {
52
        $directory = dirname((new \ReflectionClass(self::class))->getFileName());
53
54
        return $directory . '/../../Persistence/Doctrine/ORM';
55
    }
56
}
57