PluginProbe
Packeta / 1.6.2
Packeta v1.6.2
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
packeta / src / Packetery / Core / Entity / CustomsDeclaration.php

CustomsDeclaration.php in Packeta 1.6.2, at src/Packetery/Core/Entity/CustomsDeclaration.php

389 lines 6.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class CustomsDeclaration
4 *
5 * @package Packetery
6 */
7
8 declare( strict_types=1 );
9
10 namespace Packetery\Core\Entity;
11
12 /**
13 * Class CustomsDeclaration
14 */
15 class CustomsDeclaration {
16
17 /**
18 * Unique identifier.
19 *
20 * @var string
21 */
22 private $id;
23
24 /**
25 * Order ID.
26 *
27 * @var string
28 */
29 private $orderId;
30
31 /**
32 * EAD.
33 *
34 * @var string
35 */
36 private $ead;
37
38 /**
39 * Delivery cost.
40 *
41 * @var float
42 */
43 private $deliveryCost;
44
45 /**
46 * Invoice number.
47 *
48 * @var string
49 */
50 private $invoiceNumber;
51
52 /**
53 * Invoice issue date.
54 *
55 * @var \DateTimeImmutable
56 */
57 private $invoiceIssueDate;
58
59 /**
60 * Tells if invoice file has content.
61 *
62 * @var bool
63 */
64 private $hasInvoiceFileContent = false;
65
66 /**
67 * Invoice.
68 *
69 * @var callable|null
70 */
71 private $invoiceFile = null;
72
73 /**
74 * Invoice file ID.
75 *
76 * @var string|null
77 */
78 private $invoiceFileId = null;
79
80 /**
81 * MRN.
82 *
83 * @var string|null
84 */
85 private $mrn = null;
86
87 /**
88 * Tells if EAD file has content.
89 *
90 * @var bool
91 */
92 private $hasEadFileContent = false;
93
94 /**
95 * Ead file.
96 *
97 * @var callable|null
98 */
99 private $eadFile = null;
100
101 /**
102 * EAD file ID.
103 *
104 * @var string|null
105 */
106 private $eadFileId = null;
107
108 /**
109 * Customs declaration item.
110 *
111 * @var CustomsDeclarationItem[]
112 */
113 private $items = [];
114
115 /**
116 * Constructor.
117 *
118 * @param string $orderId Order ID.
119 * @param string $ead Ead.
120 * @param float $deliveryCost Delivery cost.
121 * @param string $invoiceNumber Invoice number.
122 * @param \DateTimeImmutable $invoiceIssueDate Invoice issue date.
123 */
124 public function __construct(
125 string $orderId,
126 string $ead,
127 float $deliveryCost,
128 string $invoiceNumber,
129 \DateTimeImmutable $invoiceIssueDate
130 ) {
131 $this->orderId = $orderId;
132 $this->ead = $ead;
133 $this->deliveryCost = $deliveryCost;
134 $this->invoiceNumber = $invoiceNumber;
135 $this->invoiceIssueDate = $invoiceIssueDate;
136 }
137
138 /**
139 * Gets delivery cost.
140 *
141 * @return float
142 */
143 public function getDeliveryCost(): float {
144 return $this->deliveryCost;
145 }
146
147 /**
148 * Sets delivery cost.
149 *
150 * @param float $deliveryCost Delivery cost.
151 *
152 * @return void
153 */
154 public function setDeliveryCost( float $deliveryCost ): void {
155 $this->deliveryCost = $deliveryCost;
156 }
157
158 /**
159 * Gets EAD.
160 *
161 * @return string
162 */
163 public function getEad(): string {
164 return $this->ead;
165 }
166
167 /**
168 * Set EAD.
169 *
170 * @param string $ead EAD.
171 *
172 * @return void
173 */
174 public function setEad( string $ead ): void {
175 $this->ead = $ead;
176 }
177
178 /**
179 * Gets EAD file.
180 *
181 * @return string|null
182 */
183 public function getEadFile(): ?string {
184 return call_user_func( $this->eadFile );
185 }
186
187 /**
188 * Sets EAD PDF file content.
189 *
190 * @param callable|null $eadFile EAD file content.
191 * @param bool $hasContent Tells if file has content.
192 *
193 * @return void
194 */
195 public function setEadFile( ?callable $eadFile, bool $hasContent ): void {
196 $this->eadFile = $eadFile;
197 $this->hasEadFileContent = $hasContent;
198 }
199
200 /**
201 * Gets EAD file ID.
202 *
203 * @return string|null
204 */
205 public function getEadFileId(): ?string {
206 return $this->eadFileId;
207 }
208
209 /**
210 * Sets EAD file ID.
211 *
212 * @param string|null $eadFileId EAD file ID.
213 *
214 * @return void
215 */
216 public function setEadFileId( ?string $eadFileId ): void {
217 $this->eadFileId = $eadFileId;
218 }
219
220 /**
221 * Gets ID.
222 *
223 * @return string|null
224 */
225 public function getId(): ?string {
226 return $this->id;
227 }
228
229 /**
230 * Sets ID.
231 *
232 * @param string|null $id ID.
233 *
234 * @return void
235 */
236 public function setId( ?string $id ): void {
237 $this->id = $id;
238 }
239
240 /**
241 * Gets invoice.
242 *
243 * @return string|null
244 */
245 public function getInvoiceFile(): ?string {
246 return call_user_func( $this->invoiceFile );
247 }
248
249 /**
250 * Sets invoice.
251 *
252 * @param callable|null $invoice Invoice.
253 * @param bool $hasContent Tells if file has content.
254 *
255 * @return void
256 */
257 public function setInvoiceFile( ?callable $invoice, bool $hasContent ): void {
258 $this->invoiceFile = $invoice;
259 $this->hasInvoiceFileContent = $hasContent;
260 }
261
262 /**
263 * Gets invoice file ID.
264 *
265 * @return string|null
266 */
267 public function getInvoiceFileId(): ?string {
268 return $this->invoiceFileId;
269 }
270
271 /**
272 * Sets invoice file ID.
273 *
274 * @param string|null $invoiceFileId Invoice file ID.
275 *
276 * @return void
277 */
278 public function setInvoiceFileId( ?string $invoiceFileId ): void {
279 $this->invoiceFileId = $invoiceFileId;
280 }
281
282 /**
283 * Gets invoice issue date.
284 *
285 * @return \DateTimeImmutable
286 */
287 public function getInvoiceIssueDate(): \DateTimeImmutable {
288 return $this->invoiceIssueDate;
289 }
290
291 /**
292 * Sets invoice issue date.
293 *
294 * @param \DateTimeImmutable $invoiceIssueDate Invoice issue date.
295 *
296 * @return void
297 */
298 public function setInvoiceIssueDate( \DateTimeImmutable $invoiceIssueDate ): void {
299 $this->invoiceIssueDate = $invoiceIssueDate;
300 }
301
302 /**
303 * Gets invoice number.
304 *
305 * @return string
306 */
307 public function getInvoiceNumber(): string {
308 return $this->invoiceNumber;
309 }
310
311 /**
312 * Sets invoice number.
313 *
314 * @param string $invoiceNumber Invoice number.
315 *
316 * @return void
317 */
318 public function setInvoiceNumber( string $invoiceNumber ): void {
319 $this->invoiceNumber = $invoiceNumber;
320 }
321
322 /**
323 * Gets items.
324 *
325 * @return CustomsDeclarationItem[]
326 */
327 public function getItems(): array {
328 return $this->items;
329 }
330
331 /**
332 * Sets items.
333 *
334 * @param array $items Items.
335 *
336 * @return void
337 */
338 public function setItems( array $items ): void {
339 $this->items = $items;
340 }
341
342 /**
343 * Gets MRN.
344 *
345 * @return string|null
346 */
347 public function getMrn(): ?string {
348 return $this->mrn;
349 }
350
351 /**
352 * Sets MRN.
353 *
354 * @param string|null $mrn MRN.
355 *
356 * @return void
357 */
358 public function setMrn( ?string $mrn ): void {
359 $this->mrn = $mrn;
360 }
361
362 /**
363 * Get order ID.
364 *
365 * @return string|null
366 */
367 public function getOrderId(): ?string {
368 return $this->orderId;
369 }
370
371 /**
372 * Tells if EAD file is present.
373 *
374 * @return bool
375 */
376 public function hasEadFileContent(): bool {
377 return $this->hasEadFileContent;
378 }
379
380 /**
381 * Tells if invoice file is set.
382 *
383 * @return bool
384 */
385 public function hasInvoiceFileContent(): bool {
386 return $this->hasInvoiceFileContent;
387 }
388 }
389