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\EditMaterial; |
9
|
|
|
|
10
|
|
|
use Domain\Category\Entity\CategoryInterface; |
11
|
|
|
use Domain\Unit\Enitity\UnitInterface; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Class EditMaterialRequest |
15
|
|
|
* |
16
|
|
|
* @package Domain\Material\UseCase\EditMaterial |
17
|
|
|
*/ |
18
|
|
|
class EditMaterialRequest |
19
|
|
|
{ |
20
|
|
|
/** @var int */ |
21
|
|
|
private $materialId; |
22
|
|
|
|
23
|
|
|
/** @var string */ |
24
|
|
|
private $newName; |
25
|
|
|
|
26
|
|
|
/** @var string */ |
27
|
|
|
private $newCode; |
28
|
|
|
|
29
|
|
|
/** @var CategoryInterface */ |
30
|
|
|
private $category; |
31
|
|
|
|
32
|
|
|
/** @var UnitInterface */ |
33
|
|
|
private $unit; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* EditMaterialRequest constructor. |
37
|
|
|
* |
38
|
|
|
* @param int $materialId |
39
|
|
|
* @param string $newName |
40
|
|
|
* @param string $newCode |
41
|
|
|
* @param CategoryInterface $category |
42
|
|
|
* @param UnitInterface $unit |
43
|
|
|
*/ |
44
|
|
|
public function __construct( |
45
|
|
|
$materialId, |
46
|
|
|
$newName, |
47
|
|
|
$newCode, |
48
|
|
|
CategoryInterface $category, |
49
|
|
|
UnitInterface $unit = null |
50
|
|
|
) { |
51
|
|
|
$this->materialId = $materialId; |
52
|
|
|
$this->newName = $newName; |
53
|
|
|
$this->newCode = $newCode; |
54
|
|
|
$this->category = $category; |
55
|
|
|
$this->unit = $unit; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @return int |
60
|
|
|
*/ |
61
|
|
|
public function getMaterialId() |
62
|
|
|
{ |
63
|
|
|
return $this->materialId; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return string |
68
|
|
|
*/ |
69
|
|
|
public function getNewName() |
70
|
|
|
{ |
71
|
|
|
return $this->newName; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @return string |
76
|
|
|
*/ |
77
|
|
|
public function getNewCode() |
78
|
|
|
{ |
79
|
|
|
return $this->newCode; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @return CategoryInterface |
84
|
|
|
*/ |
85
|
|
|
public function getCategory() |
86
|
|
|
{ |
87
|
|
|
return $this->category; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @return UnitInterface|null |
92
|
|
|
*/ |
93
|
|
|
public function getUnit() |
94
|
|
|
{ |
95
|
|
|
return $this->unit; |
96
|
|
|
} |
97
|
|
|
} |