|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace VasilDakov\Speedy\Service\Calculation; |
|
6
|
|
|
|
|
7
|
|
|
use VasilDakov\Speedy\ToArray; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* Class CalculationRecipient |
|
11
|
|
|
* |
|
12
|
|
|
* @author Vasil Dakov <[email protected]> |
|
13
|
|
|
* @copyright 2009-2022 Neutrino.bg |
|
14
|
|
|
* @version 1.0 |
|
15
|
|
|
*/ |
|
16
|
|
|
class CalculationRecipient |
|
17
|
|
|
{ |
|
18
|
|
|
use ToArray; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @var bool |
|
22
|
|
|
*/ |
|
23
|
|
|
private bool $privatePerson; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @var CalculationAddressLocation|null |
|
27
|
|
|
*/ |
|
28
|
|
|
private ?CalculationAddressLocation $addressLocation = null; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @var int|null |
|
32
|
|
|
*/ |
|
33
|
|
|
private ?int $siteId = null; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @var int|null |
|
37
|
|
|
*/ |
|
38
|
|
|
private ?int $pickupOfficeId = null; |
|
39
|
|
|
|
|
40
|
3 |
|
public function __construct( |
|
41
|
|
|
bool $privatePerson, |
|
42
|
|
|
?int $pickupOfficeId = null, |
|
43
|
|
|
?CalculationAddressLocation $addressLocation = null |
|
44
|
|
|
) { |
|
45
|
3 |
|
$this->privatePerson = $privatePerson; |
|
46
|
3 |
|
$this->pickupOfficeId = $pickupOfficeId; |
|
47
|
3 |
|
$this->addressLocation = $addressLocation; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @return bool |
|
52
|
|
|
*/ |
|
53
|
1 |
|
public function isPrivatePerson(): bool |
|
54
|
|
|
{ |
|
55
|
1 |
|
return $this->privatePerson; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @param int|null $siteId |
|
61
|
|
|
*/ |
|
62
|
|
|
public function setSiteId(?int $siteId): void |
|
63
|
|
|
{ |
|
64
|
|
|
$this->siteId = $siteId; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* @return int|null |
|
69
|
|
|
*/ |
|
70
|
|
|
public function getSiteId(): ?int |
|
71
|
|
|
{ |
|
72
|
|
|
return $this->siteId; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @param int|null $pickupOfficeId |
|
77
|
|
|
*/ |
|
78
|
|
|
public function setPickupOfficeId(?int $pickupOfficeId): void |
|
79
|
|
|
{ |
|
80
|
|
|
$this->pickupOfficeId = $pickupOfficeId; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* @return int|null |
|
85
|
|
|
*/ |
|
86
|
1 |
|
public function getPickupOfficeId(): ?int |
|
87
|
|
|
{ |
|
88
|
1 |
|
return $this->pickupOfficeId; |
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* @return CalculationAddressLocation|null |
|
93
|
|
|
*/ |
|
94
|
1 |
|
public function getAddressLocation(): ?CalculationAddressLocation |
|
95
|
|
|
{ |
|
96
|
1 |
|
return $this->addressLocation; |
|
97
|
|
|
} |
|
98
|
|
|
} |
|
99
|
|
|
|