| 1 |
<?php |
| 2 |
/** |
| 3 |
* Class BaseProvider |
| 4 |
* |
| 5 |
* @package Packetery |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace Packetery\Core\PickupPointProvider; |
| 11 |
|
| 12 |
/** |
| 13 |
* Class BaseProvider |
| 14 |
* |
| 15 |
* @package Packetery |
| 16 |
*/ |
| 17 |
abstract class BaseProvider { |
| 18 |
|
| 19 |
/** |
| 20 |
* Id. |
| 21 |
* |
| 22 |
* @var string |
| 23 |
*/ |
| 24 |
protected $id; |
| 25 |
/** |
| 26 |
* Country. |
| 27 |
* |
| 28 |
* @var string |
| 29 |
*/ |
| 30 |
protected $country; |
| 31 |
/** |
| 32 |
* Name. |
| 33 |
* |
| 34 |
* @var string |
| 35 |
*/ |
| 36 |
protected $name; |
| 37 |
/** |
| 38 |
* Supports COD?. |
| 39 |
* |
| 40 |
* @var bool |
| 41 |
*/ |
| 42 |
protected $supportsCod; |
| 43 |
/** |
| 44 |
* Supports age verification?. |
| 45 |
* |
| 46 |
* @var bool |
| 47 |
*/ |
| 48 |
protected $supportsAgeVerification; |
| 49 |
/** |
| 50 |
* Currency. |
| 51 |
* |
| 52 |
* @var string |
| 53 |
*/ |
| 54 |
protected $currency; |
| 55 |
/** |
| 56 |
* Has pickup points?. |
| 57 |
* |
| 58 |
* @var bool |
| 59 |
*/ |
| 60 |
protected $hasPickupPoints; |
| 61 |
|
| 62 |
/** |
| 63 |
* BaseProvider constructor. |
| 64 |
* |
| 65 |
* @param string $id Id. |
| 66 |
* @param string $country Country. |
| 67 |
* @param bool $supportsCod Supports COD. |
| 68 |
* @param bool $supportsAgeVerification Supports age verification. |
| 69 |
* @param string $currency Currency. |
| 70 |
* @param bool $hasPickupPoints Is pickup points?. |
| 71 |
*/ |
| 72 |
public function __construct( |
| 73 |
string $id, |
| 74 |
string $country, |
| 75 |
bool $supportsCod, |
| 76 |
bool $supportsAgeVerification, |
| 77 |
string $currency, |
| 78 |
bool $hasPickupPoints |
| 79 |
) { |
| 80 |
$this->id = $id; |
| 81 |
$this->country = $country; |
| 82 |
$this->supportsCod = $supportsCod; |
| 83 |
$this->supportsAgeVerification = $supportsAgeVerification; |
| 84 |
$this->currency = $currency; |
| 85 |
$this->hasPickupPoints = $hasPickupPoints; |
| 86 |
} |
| 87 |
|
| 88 |
/** |
| 89 |
* Translated name setter. |
| 90 |
* |
| 91 |
* @param string $translatedName Translated name. |
| 92 |
* |
| 93 |
* @return void |
| 94 |
*/ |
| 95 |
public function setTranslatedName( string $translatedName ): void { |
| 96 |
$this->name = $translatedName; |
| 97 |
} |
| 98 |
|
| 99 |
/** |
| 100 |
* Id getter. |
| 101 |
* |
| 102 |
* @return string |
| 103 |
*/ |
| 104 |
public function getId(): string { |
| 105 |
return $this->id; |
| 106 |
} |
| 107 |
|
| 108 |
/** |
| 109 |
* Country getter. |
| 110 |
* |
| 111 |
* @return string |
| 112 |
*/ |
| 113 |
public function getCountry(): string { |
| 114 |
return $this->country; |
| 115 |
} |
| 116 |
|
| 117 |
/** |
| 118 |
* Name getter. |
| 119 |
* |
| 120 |
* @return string |
| 121 |
*/ |
| 122 |
public function getName(): string { |
| 123 |
return $this->name; |
| 124 |
} |
| 125 |
|
| 126 |
/** |
| 127 |
* Currency getter. |
| 128 |
* |
| 129 |
* @return string |
| 130 |
*/ |
| 131 |
public function getCurrency(): string { |
| 132 |
return $this->currency; |
| 133 |
} |
| 134 |
|
| 135 |
/** |
| 136 |
* COD support getter. |
| 137 |
* |
| 138 |
* @return bool |
| 139 |
*/ |
| 140 |
public function supportsCod(): bool { |
| 141 |
return $this->supportsCod; |
| 142 |
} |
| 143 |
|
| 144 |
/** |
| 145 |
* Age verification getter. |
| 146 |
* |
| 147 |
* @return bool |
| 148 |
*/ |
| 149 |
public function supportsAgeVerification(): bool { |
| 150 |
return $this->supportsAgeVerification; |
| 151 |
} |
| 152 |
|
| 153 |
/** |
| 154 |
* Has pickup points? |
| 155 |
* |
| 156 |
* @return bool |
| 157 |
*/ |
| 158 |
public function hasPickupPoints(): bool { |
| 159 |
return $this->hasPickupPoints; |
| 160 |
} |
| 161 |
|
| 162 |
} |
| 163 |
|