1 | <?php |
||
8 | class PaymentLine |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $productNumber; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $name; |
||
19 | |||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | protected $quantity; |
||
24 | |||
25 | /** |
||
26 | * The price excl vat. |
||
27 | * |
||
28 | * @var Money |
||
29 | */ |
||
30 | protected $price; |
||
31 | |||
32 | /** |
||
33 | * This is the VAT percentage, i.e. 25 for Denmark. |
||
34 | * |
||
35 | * @var int |
||
36 | */ |
||
37 | protected $vat; |
||
38 | |||
39 | /** |
||
40 | * @var Payment |
||
41 | */ |
||
42 | protected $payment; |
||
43 | |||
44 | /** |
||
45 | * @param string $productNumber |
||
46 | * @param string $name |
||
47 | * @param int $quantity |
||
48 | * @param Money $price |
||
49 | * @param int $vat |
||
50 | */ |
||
51 | 9 | public function __construct(string $productNumber, string $name, int $quantity, Money $price, int $vat) |
|
59 | |||
60 | /****************** |
||
61 | * Helper methods * |
||
62 | *****************/ |
||
63 | |||
64 | /** |
||
65 | * @return Money |
||
66 | */ |
||
67 | 3 | public function getPriceExclVat(): Money |
|
71 | |||
72 | /** |
||
73 | * @return Money |
||
74 | */ |
||
75 | 3 | public function getPriceInclVat(): Money |
|
82 | |||
83 | /********************* |
||
84 | * Getters / Setters * |
||
85 | ********************/ |
||
86 | |||
87 | /** |
||
88 | * @return string |
||
89 | */ |
||
90 | 6 | public function getProductNumber(): string |
|
94 | |||
95 | /** |
||
96 | * @param string $productNumber |
||
97 | * |
||
98 | * @return PaymentLine |
||
99 | */ |
||
100 | 9 | public function setProductNumber(string $productNumber): self |
|
106 | |||
107 | /** |
||
108 | * @return string |
||
109 | */ |
||
110 | 6 | public function getName(): string |
|
114 | |||
115 | /** |
||
116 | * @param string $name |
||
117 | * |
||
118 | * @return PaymentLine |
||
119 | */ |
||
120 | 9 | public function setName(string $name): self |
|
126 | |||
127 | /** |
||
128 | * @return int |
||
129 | */ |
||
130 | 6 | public function getQuantity(): int |
|
134 | |||
135 | /** |
||
136 | * @param int $quantity |
||
137 | * |
||
138 | * @return PaymentLine |
||
139 | */ |
||
140 | 9 | public function setQuantity(int $quantity): self |
|
146 | |||
147 | /** |
||
148 | * Returns the price excl vat. |
||
149 | * |
||
150 | * @return Money |
||
151 | */ |
||
152 | 6 | public function getPrice(): Money |
|
156 | |||
157 | /** |
||
158 | * @param Money $price |
||
159 | * |
||
160 | * @return PaymentLine |
||
161 | */ |
||
162 | 9 | public function setPrice(Money $price): self |
|
168 | |||
169 | /** |
||
170 | * Returns the VAT percentage. |
||
171 | * |
||
172 | * @return int |
||
173 | */ |
||
174 | 6 | public function getVat(): int |
|
178 | |||
179 | /** |
||
180 | * @param int $vat |
||
181 | * |
||
182 | * @return PaymentLine |
||
183 | */ |
||
184 | 9 | public function setVat(int $vat): self |
|
190 | |||
191 | /** |
||
192 | * @return Payment |
||
193 | */ |
||
194 | 3 | public function getPayment(): Payment |
|
198 | |||
199 | /** |
||
200 | * @param Payment $payment |
||
201 | * |
||
202 | * @return PaymentLine |
||
203 | */ |
||
204 | 6 | public function setPayment(Payment $payment): self |
|
210 | } |
||
211 |