Completed
Branch resource-configuration-builder (c854d7)
by Kamil
13:53
created

SyliusResource::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 3
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
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 Sylius\Bundle\ResourceBundle\DependencyInjection\Configuration;
13
14
/**
15
 * @author Kamil Kokot <[email protected]>
16
 */
17
final class SyliusResource extends AbstractSyliusResource
18
{
19
    /**
20
     * @var string
21
     */
22
    private $name;
23
24
    /**
25
     * @var SyliusTranslationResource
26
     */
27
    private $translationResource;
28
29
    /**
30
     * @param string $name
31
     * @param string|null $modelClass
32
     * @param string|null $interfaceClass
33
     */
34
    public function __construct($name, $modelClass = null, $interfaceClass = null)
35
    {
36
        parent::__construct($modelClass, $interfaceClass);
37
38
        $this->name = $name;
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getName()
45
    {
46
        return $this->name;
47
    }
48
49
    /**
50
     * @return SyliusTranslationResource|null
51
     */
52
    public function getTranslationResource()
53
    {
54
        return $this->translationResource;
55
    }
56
57
    /**
58
     * @param SyliusTranslationResource $translationResource
59
     *
60
     * @return $this
61
     */
62
    public function useTranslationResource(SyliusTranslationResource $translationResource)
63
    {
64
        $this->translationResource = $translationResource;
65
66
        return $this;
67
    }
68
}
69