woo-postnl
/
vendor
/
myparcelnl
/
sdk
/
src
/
Adapter
/
DeliveryOptions
/
AbstractPickupLocationAdapter.php
AbstractPickupLocationAdapter.php in PostNL for WooCommerce 4.4.1, at vendor/myparcelnl/sdk/src/Adapter/DeliveryOptions/AbstractPickupLocationAdapter.php
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace MyParcelNL\Sdk\src\Adapter\DeliveryOptions; |
| 4 | |
| 5 | class AbstractPickupLocationAdapter |
| 6 | { |
| 7 | /** |
| 8 | * @var string |
| 9 | */ |
| 10 | protected $location_name; |
| 11 | |
| 12 | /** |
| 13 | * @var string |
| 14 | */ |
| 15 | protected $location_code; |
| 16 | |
| 17 | /** |
| 18 | * @var string|null |
| 19 | */ |
| 20 | protected $retail_network_id; |
| 21 | |
| 22 | /** |
| 23 | * @var string |
| 24 | */ |
| 25 | protected $street; |
| 26 | |
| 27 | /** |
| 28 | * @var string |
| 29 | */ |
| 30 | protected $number; |
| 31 | |
| 32 | /** |
| 33 | * @var string |
| 34 | */ |
| 35 | protected $postal_code; |
| 36 | |
| 37 | /** |
| 38 | * @var string |
| 39 | */ |
| 40 | protected $city; |
| 41 | |
| 42 | /** |
| 43 | * @var string |
| 44 | */ |
| 45 | protected $cc; |
| 46 | |
| 47 | /** |
| 48 | * @return string |
| 49 | */ |
| 50 | public function getLocationName(): string |
| 51 | { |
| 52 | return $this->location_name; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * @return string |
| 57 | */ |
| 58 | public function getLocationCode(): string |
| 59 | { |
| 60 | return $this->location_code; |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * @return string|null |
| 65 | * @deprecated Use getRetailNetworkId instead |
| 66 | */ |
| 67 | public function getPickupNetworkId(): ?string |
| 68 | { |
| 69 | return $this->getRetailNetworkId(); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * @return string|null |
| 74 | */ |
| 75 | public function getRetailNetworkId(): ?string |
| 76 | { |
| 77 | return $this->retail_network_id; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * @return string |
| 82 | */ |
| 83 | public function getStreet(): string |
| 84 | { |
| 85 | return $this->street; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * @return string |
| 90 | */ |
| 91 | public function getNumber(): string |
| 92 | { |
| 93 | return $this->number; |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * @return string |
| 98 | */ |
| 99 | public function getPostalCode(): string |
| 100 | { |
| 101 | return $this->postal_code; |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * @return string |
| 106 | */ |
| 107 | public function getCity(): string |
| 108 | { |
| 109 | return $this->city; |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * @return string |
| 114 | */ |
| 115 | public function getCountry(): ?string |
| 116 | { |
| 117 | return $this->cc; |
| 118 | } |
| 119 | |
| 120 | /** |
| 121 | * @param string $cc |
| 122 | */ |
| 123 | public function setCountry(string $cc): void |
| 124 | { |
| 125 | $this->cc = $cc; |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * @return array |
| 130 | */ |
| 131 | public function toArray(): array |
| 132 | { |
| 133 | return [ |
| 134 | 'location_name' => $this->getLocationName(), |
| 135 | 'location_code' => $this->getLocationCode(), |
| 136 | 'retail_network_id' => $this->getRetailNetworkId(), |
| 137 | 'street' => $this->getStreet(), |
| 138 | 'number' => $this->getNumber(), |
| 139 | 'postal_code' => $this->getPostalCode(), |
| 140 | 'city' => $this->getCity(), |
| 141 | 'cc' => $this->getCountry(), |
| 142 | ]; |
| 143 | } |
| 144 | } |
| 145 |