1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace VasilDakov\Speedy\Service\Calculation; |
||
6 | |||
7 | use VasilDakov\Speedy\Service\Shipment\ShipmentRecipient; |
||
8 | use VasilDakov\Speedy\Traits\ToArray; |
||
9 | |||
10 | /** |
||
11 | * Class CalculationRecipient. |
||
12 | * |
||
13 | * @author Vasil Dakov <[email protected]> |
||
14 | * @copyright 2009-2022 Neutrino.bg |
||
15 | * |
||
16 | * @version 1.0 |
||
17 | */ |
||
18 | class CalculationRecipient extends ShipmentRecipient |
||
19 | { |
||
20 | use ToArray; |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
21 | |||
22 | private bool $privatePerson; |
||
23 | |||
24 | private ?CalculationAddressLocation $addressLocation = null; |
||
25 | |||
26 | private ?int $siteId = null; |
||
27 | |||
28 | private ?int $pickupOfficeId = null; |
||
29 | |||
30 | 5 | public function __construct( |
|
31 | bool $privatePerson, |
||
32 | int $pickupOfficeId = null, |
||
33 | CalculationAddressLocation $addressLocation = null |
||
34 | ) { |
||
35 | 5 | $this->privatePerson = $privatePerson; |
|
36 | 5 | $this->pickupOfficeId = $pickupOfficeId; |
|
37 | 5 | $this->addressLocation = $addressLocation; |
|
38 | } |
||
39 | |||
40 | 1 | public function isPrivatePerson(): bool |
|
41 | { |
||
42 | 1 | return $this->privatePerson; |
|
43 | } |
||
44 | |||
45 | 1 | public function setSiteId(?int $siteId): void |
|
46 | { |
||
47 | 1 | $this->siteId = $siteId; |
|
48 | } |
||
49 | |||
50 | 1 | public function getSiteId(): ?int |
|
51 | { |
||
52 | 1 | return $this->siteId; |
|
53 | } |
||
54 | |||
55 | 1 | public function setPickupOfficeId(?int $pickupOfficeId): void |
|
56 | { |
||
57 | 1 | $this->pickupOfficeId = $pickupOfficeId; |
|
58 | } |
||
59 | |||
60 | 1 | public function getPickupOfficeId(): ?int |
|
61 | { |
||
62 | 1 | return $this->pickupOfficeId; |
|
63 | } |
||
64 | |||
65 | 1 | public function getAddressLocation(): ?CalculationAddressLocation |
|
66 | { |
||
67 | 1 | return $this->addressLocation; |
|
68 | } |
||
69 | } |
||
70 |