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