1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
namespace InvoiceNinjaModule\Model; |
5
|
|
|
|
6
|
|
|
use InvoiceNinjaModule\Model\Interfaces\ProductInterface; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class Product |
10
|
|
|
* @codeCoverageIgnore |
11
|
|
|
*/ |
12
|
|
|
final class Product extends Base implements ProductInterface |
13
|
|
|
{ |
14
|
|
|
/** @var string */ |
15
|
|
|
private $productKey = ''; |
16
|
|
|
/** @var string */ |
17
|
|
|
private $notes = ''; |
18
|
|
|
/** @var float */ |
19
|
|
|
private $cost = 0; |
20
|
|
|
/** @var float */ |
21
|
|
|
private $qty; |
22
|
|
|
/** @var string */ |
23
|
|
|
private $taxName1; |
24
|
|
|
/** @var string */ |
25
|
|
|
private $taxName2; |
26
|
|
|
/** @var float */ |
27
|
|
|
private $taxRate1; |
28
|
|
|
/** @var float */ |
29
|
|
|
private $taxRate2; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @return string |
33
|
|
|
*/ |
34
|
|
|
public function getProductKey() : string |
35
|
|
|
{ |
36
|
|
|
return $this->productKey; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @param string $productKey |
41
|
|
|
*/ |
42
|
|
|
public function setProductKey(string $productKey) :void |
43
|
|
|
{ |
44
|
|
|
$this->productKey = $productKey; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @return string |
49
|
|
|
*/ |
50
|
|
|
public function getNotes() : string |
51
|
|
|
{ |
52
|
|
|
return $this->notes; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @param string $notes |
57
|
|
|
*/ |
58
|
|
|
public function setNotes(string $notes) :void |
59
|
|
|
{ |
60
|
|
|
$this->notes = $notes; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @return float |
65
|
|
|
*/ |
66
|
|
|
public function getCost() : float |
67
|
|
|
{ |
68
|
|
|
return (float)$this->cost; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @param float $cost |
73
|
|
|
*/ |
74
|
|
|
public function setCost(float $cost) :void |
75
|
|
|
{ |
76
|
|
|
$this->cost = $cost; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @return float |
81
|
|
|
*/ |
82
|
|
|
public function getQty() : float |
83
|
|
|
{ |
84
|
|
|
return $this->qty; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @param float $qty |
89
|
|
|
*/ |
90
|
|
|
public function setQty(float $qty) :void |
91
|
|
|
{ |
92
|
|
|
$this->qty = $qty; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @return string |
97
|
|
|
*/ |
98
|
|
|
public function getTaxName1() : string |
99
|
|
|
{ |
100
|
|
|
return $this->taxName1; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @param string $taxName1 |
105
|
|
|
*/ |
106
|
|
|
public function setTaxName1(string $taxName1) :void |
107
|
|
|
{ |
108
|
|
|
$this->taxName1 = $taxName1; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* @return string |
113
|
|
|
*/ |
114
|
|
|
public function getTaxName2() : string |
115
|
|
|
{ |
116
|
|
|
return $this->taxName2; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* @param string $taxName2 |
121
|
|
|
*/ |
122
|
|
|
public function setTaxName2(string $taxName2) :void |
123
|
|
|
{ |
124
|
|
|
$this->taxName2 = $taxName2; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @return float |
129
|
|
|
*/ |
130
|
|
|
public function getTaxRate1() : float |
131
|
|
|
{ |
132
|
|
|
return $this->taxRate1; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @param float $taxRate1 |
137
|
|
|
*/ |
138
|
|
|
public function setTaxRate1(float $taxRate1) :void |
139
|
|
|
{ |
140
|
|
|
$this->taxRate1 = $taxRate1; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @return float |
145
|
|
|
*/ |
146
|
|
|
public function getTaxRate2() : float |
147
|
|
|
{ |
148
|
|
|
return $this->taxRate2; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @param float $taxRate2 |
153
|
|
|
*/ |
154
|
|
|
public function setTaxRate2(float $taxRate2) :void |
155
|
|
|
{ |
156
|
|
|
$this->taxRate2 = $taxRate2; |
157
|
|
|
} |
158
|
|
|
} |
159
|
|
|
|