CreateMaterialRequest::getCategory()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * (c) Tomasz Kunicki <[email protected]>
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
namespace Domain\Material\UseCase\CreateMaterial;
9
10
use Domain\Category\Entity\CategoryInterface;
11
use Domain\Unit\Enitity\UnitInterface;
12
13
/**
14
 * Class CreateMaterialRequest
15
 *
16
 * @package Domain\Material\UseCase\CreateMaterial
17
 */
18
class CreateMaterialRequest
19
{
20
    /** @var  string */
21
    private $name;
22
23
    /** @var  string */
24
    private $code;
25
26
    /** @var  UnitInterface */
27
    private $unit;
28
29
    /** @var  CategoryInterface */
30
    private $category;
31
32
    /**
33
     * CreateMaterialRequest constructor.
34
     *
35
     * @param string $name
36
     * @param string $code
37
     * @param UnitInterface $unit
38
     * @param CategoryInterface $category
39
     */
40
    public function __construct($name, $code, CategoryInterface $category, UnitInterface $unit = null)
41
    {
42
        $this->name = $name;
43
        $this->code = $code;
44
        $this->category = $category;
45
        $this->unit = $unit;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getName()
52
    {
53
        return $this->name;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getCode()
60
    {
61
        return $this->code;
62
    }
63
64
    /**
65
     * @return UnitInterface|null
66
     */
67
    public function getUnit()
68
    {
69
        return $this->unit;
70
    }
71
72
    /**
73
     * @return CategoryInterface
74
     */
75
    public function getCategory()
76
    {
77
        return $this->category;
78
    }
79
}