vasildakov /
speedy
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace VasilDakov\Speedy\Service\Shipment; |
||
| 6 | |||
| 7 | use VasilDakov\Speedy\Traits\ToArray; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Class ShipmentRecipient. |
||
| 11 | * |
||
| 12 | * @author Valentin Valkanov <[email protected]> |
||
| 13 | * @author Vasil Dakov <[email protected]> |
||
| 14 | * @psalm-suppress MissingConstructor |
||
| 15 | */ |
||
| 16 | class ShipmentRecipient |
||
| 17 | { |
||
| 18 | use ToArray; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 19 | |||
| 20 | private ShipmentPhoneNumber $phone1; |
||
| 21 | |||
| 22 | private ?ShipmentPhoneNumber $phone2 = null; |
||
| 23 | |||
| 24 | private ?ShipmentPhoneNumber $phone3 = null; |
||
| 25 | |||
| 26 | private string $clientName; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var ?string |
||
| 30 | */ |
||
| 31 | private ?string $objectName = null; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var ?string |
||
| 35 | */ |
||
| 36 | private ?string $contactName = null; |
||
| 37 | |||
| 38 | private string $email; |
||
| 39 | |||
| 40 | private bool $privatePerson = true; |
||
| 41 | |||
| 42 | private ?ShipmentAddress $address; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @var ?int |
||
| 46 | */ |
||
| 47 | private ?int $pickupOfficeId = null; |
||
| 48 | |||
| 49 | 12 | public function __construct( |
|
| 50 | ShipmentPhoneNumber $phone1, |
||
| 51 | string $clientName, |
||
| 52 | string $email, |
||
| 53 | ShipmentAddress $address = null, |
||
| 54 | int $pickupOfficeId = null, |
||
| 55 | ) { |
||
| 56 | 12 | $this->phone1 = $phone1; |
|
| 57 | 12 | $this->clientName = $clientName; |
|
| 58 | 12 | $this->email = $email; |
|
| 59 | 12 | $this->address = $address; |
|
| 60 | 12 | $this->pickupOfficeId = $pickupOfficeId; |
|
| 61 | } |
||
| 62 | |||
| 63 | 1 | public function getPhone1(): ShipmentPhoneNumber |
|
| 64 | { |
||
| 65 | 1 | return $this->phone1; |
|
| 66 | } |
||
| 67 | |||
| 68 | 1 | public function setPhone1(ShipmentPhoneNumber $phone1): void |
|
| 69 | { |
||
| 70 | 1 | $this->phone1 = $phone1; |
|
| 71 | } |
||
| 72 | |||
| 73 | 1 | public function getPhone2(): ?ShipmentPhoneNumber |
|
| 74 | { |
||
| 75 | 1 | return $this->phone2; |
|
| 76 | } |
||
| 77 | |||
| 78 | 1 | public function setPhone2(ShipmentPhoneNumber $phone2): void |
|
| 79 | { |
||
| 80 | 1 | $this->phone2 = $phone2; |
|
| 81 | } |
||
| 82 | |||
| 83 | 1 | public function getPhone3(): ?ShipmentPhoneNumber |
|
| 84 | { |
||
| 85 | 1 | return $this->phone3; |
|
| 86 | } |
||
| 87 | |||
| 88 | 1 | public function setPhone3(ShipmentPhoneNumber $phone3): void |
|
| 89 | { |
||
| 90 | 1 | $this->phone3 = $phone3; |
|
| 91 | } |
||
| 92 | |||
| 93 | 1 | public function getClientName(): string |
|
| 94 | { |
||
| 95 | 1 | return $this->clientName; |
|
| 96 | } |
||
| 97 | |||
| 98 | 1 | public function setClientName(string $clientName): void |
|
| 99 | { |
||
| 100 | 1 | $this->clientName = $clientName; |
|
| 101 | } |
||
| 102 | |||
| 103 | 1 | public function getObjectName(): ?string |
|
| 104 | { |
||
| 105 | 1 | return $this->objectName; |
|
| 106 | } |
||
| 107 | |||
| 108 | 1 | public function setObjectName(string $objectName): void |
|
| 109 | { |
||
| 110 | 1 | $this->objectName = $objectName; |
|
| 111 | } |
||
| 112 | |||
| 113 | 1 | public function getContactName(): ?string |
|
| 114 | { |
||
| 115 | 1 | return $this->contactName; |
|
| 116 | } |
||
| 117 | |||
| 118 | 1 | public function setContactName(string $contactName): void |
|
| 119 | { |
||
| 120 | 1 | $this->contactName = $contactName; |
|
| 121 | } |
||
| 122 | |||
| 123 | 1 | public function getEmail(): string |
|
| 124 | { |
||
| 125 | 1 | return $this->email; |
|
| 126 | } |
||
| 127 | |||
| 128 | 1 | public function setEmail(string $email): void |
|
| 129 | { |
||
| 130 | 1 | $this->email = $email; |
|
| 131 | } |
||
| 132 | |||
| 133 | 1 | public function getPrivatePerson(): bool |
|
| 134 | { |
||
| 135 | 1 | return $this->privatePerson; |
|
| 136 | } |
||
| 137 | |||
| 138 | 1 | public function setPrivatePerson(bool $privatePerson): void |
|
| 139 | { |
||
| 140 | 1 | $this->privatePerson = $privatePerson; |
|
| 141 | } |
||
| 142 | |||
| 143 | 2 | public function getAddress(): ?ShipmentAddress |
|
| 144 | { |
||
| 145 | 2 | return $this->address; |
|
| 146 | } |
||
| 147 | |||
| 148 | 1 | public function setAddress(ShipmentAddress $address = null): void |
|
| 149 | { |
||
| 150 | 1 | $this->address = $address; |
|
| 151 | } |
||
| 152 | |||
| 153 | 1 | public function getPickupOfficeId(): ?int |
|
| 154 | { |
||
| 155 | 1 | return $this->pickupOfficeId; |
|
| 156 | } |
||
| 157 | |||
| 158 | 1 | public function setPickupOfficeId(int $pickupOfficeId): void |
|
| 159 | { |
||
| 160 | 1 | $this->pickupOfficeId = $pickupOfficeId; |
|
| 161 | } |
||
| 162 | } |
||
| 163 |