Completed
Push — master ( 2c026b...1dd487 )
by Beñat
05:32 queued 02:43
created

FileOfIdQueryBuilder::aliasDefinitionName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the BenGorFile package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace BenGorFile\FileBundle\DependencyInjection\Compiler\Application\Query;
14
15
use BenGorFile\File\Application\Query\FileOfIdHandler;
16
use Symfony\Component\DependencyInjection\Definition;
17
18
/**
19
 * File of id query builder.
20
 *
21
 * @author Beñat Espiña <[email protected]>
22
 */
23
class FileOfIdQueryBuilder extends QueryBuilder
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function register($file)
29
    {
30
        $this->container->setDefinition(
31
            $this->definitionName($file),
32
            (new Definition(
33
                FileOfIdHandler::class, [
34
                    $this->container->getDefinition(
35
                        'bengor.file.infrastructure.persistence.' . $file . '_repository'
36
                    ),
37
                    $this->container->getDefinition(
38
                        'bengor.file.application.data_transformer.' . $file . '_dto'
39
                    ),
40
                ]
41
            ))->setPublic(false)
42
        );
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    protected function definitionName($file)
49
    {
50
        return 'bengor.file.application.query.' . $file . '_of_id';
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    protected function aliasDefinitionName($file)
57
    {
58
        return 'bengor_file.' . $file . '.by_id_query';
59
    }
60
}
61