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

SyliusResource   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 52
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getName() 0 4 1
A getTranslationResource() 0 4 1
A useTranslationResource() 0 6 1
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