PluginProbe
Packeta / 1.5.0
Packeta v1.5.0
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
packeta / src / Packetery / Core / Entity / Carrier.php

Carrier.php in Packeta 1.5.0, at src/Packetery/Core/Entity/Carrier.php

325 lines 5.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class Carrier
4 *
5 * @package Packetery\Entities
6 */
7
8 declare( strict_types=1 );
9
10 namespace Packetery\Core\Entity;
11
12 /**
13 * Class Carrier
14 *
15 * @package Packetery\Entities
16 */
17 class Carrier {
18
19 public const INTERNAL_PICKUP_POINTS_ID = 'packeta';
20 public const VENDOR_GROUP_ZPOINT = 'zpoint';
21 public const ADDRESS_VALIDATION_COUNTRIES = [ 'cz', 'sk' ];
22
23 /**
24 * Carrier id.
25 *
26 * @var string
27 */
28 private $id;
29
30 /**
31 * Carrier name.
32 *
33 * @var string
34 */
35 private $name;
36
37 /**
38 * Carrier hasPickupPoints.
39 *
40 * @var bool
41 */
42 private $hasPickupPoints;
43
44 /**
45 * Carrier hasDirectLabel.
46 *
47 * @var bool
48 */
49 private $hasDirectLabel;
50
51 /**
52 * Carrier requiresSeparateHouseNumber.
53 *
54 * @var bool
55 */
56 private $requiresSeparateHouseNumber;
57
58 /**
59 * Carrier requiresCustomsDeclarations.
60 *
61 * @var bool
62 */
63 private $requiresCustomsDeclarations;
64
65 /**
66 * Carrier requiresEmail.
67 *
68 * @var bool
69 */
70 private $requiresEmail;
71
72 /**
73 * Carrier requiresPhone.
74 *
75 * @var bool
76 */
77 private $requiresPhone;
78
79 /**
80 * Carrier requiresSize.
81 *
82 * @var bool
83 */
84 private $requiresSize;
85
86 /**
87 * Carrier supportsCod.
88 *
89 * @var bool
90 */
91 private $supportsCod;
92
93 /**
94 * Carrier country.
95 *
96 * @var string
97 */
98 private $country;
99
100 /**
101 * Carrier currency.
102 *
103 * @var string
104 */
105 private $currency;
106
107 /**
108 * Carrier maxWeight.
109 *
110 * @var float
111 */
112 private $maxWeight;
113
114 /**
115 * Carrier isDeleted.
116 *
117 * @var bool
118 */
119 private $isDeleted;
120
121 /**
122 * Carrier allows age verification.
123 *
124 * @var bool
125 */
126 private $ageVerification;
127
128 /**
129 * Carrier constructor.
130 *
131 * @param string $id Carrier id.
132 * @param string $name Carrier name.
133 * @param bool $hasPickupPoints Carrier hasPickupPoints.
134 * @param bool $hasDirectLabel Carrier hasDirectLabel.
135 * @param bool $requiresSeparateHouseNumber Carrier requiresSeparateHouseNumber.
136 * @param bool $requiresCustomsDeclarations Carrier requiresCustomsDeclarations.
137 * @param bool $requiresEmail Carrier requiresEmail.
138 * @param bool $requiresPhone Carrier requiresPhone.
139 * @param bool $requiresSize Carrier requiresSize.
140 * @param bool $supportsCod Carrier supportsCod.
141 * @param string $country Carrier country.
142 * @param string $currency Carrier currency.
143 * @param float $maxWeight Carrier maxWeight.
144 * @param bool $isDeleted Carrier isDeleted.
145 * @param bool $ageVerification Carrier supports age verification.
146 */
147 public function __construct(
148 string $id,
149 string $name,
150 bool $hasPickupPoints,
151 bool $hasDirectLabel,
152 bool $requiresSeparateHouseNumber,
153 bool $requiresCustomsDeclarations,
154 bool $requiresEmail,
155 bool $requiresPhone,
156 bool $requiresSize,
157 bool $supportsCod,
158 string $country,
159 string $currency,
160 float $maxWeight,
161 bool $isDeleted,
162 bool $ageVerification
163 ) {
164 $this->id = $id;
165 $this->name = $name;
166 $this->hasPickupPoints = $hasPickupPoints;
167 $this->hasDirectLabel = $hasDirectLabel;
168 $this->requiresSeparateHouseNumber = $requiresSeparateHouseNumber;
169 $this->requiresCustomsDeclarations = $requiresCustomsDeclarations;
170 $this->requiresEmail = $requiresEmail;
171 $this->requiresPhone = $requiresPhone;
172 $this->requiresSize = $requiresSize;
173 $this->supportsCod = $supportsCod;
174 $this->country = $country;
175 $this->currency = $currency;
176 $this->maxWeight = $maxWeight;
177 $this->isDeleted = $isDeleted;
178 $this->ageVerification = $ageVerification;
179 }
180
181 /**
182 * Returns all properties as array.
183 *
184 * @return array
185 */
186 public function __toArray(): array {
187 return get_object_vars( $this );
188 }
189
190 /**
191 * Gets carrier id.
192 *
193 * @return string
194 */
195 public function getId(): string {
196 return $this->id;
197 }
198
199 /**
200 * Gets carrier name.
201 *
202 * @return string
203 */
204 public function getName(): string {
205 return $this->name;
206 }
207
208 /**
209 * Gets carrier hasPickupPoints.
210 *
211 * @return bool
212 */
213 public function hasPickupPoints(): bool {
214 return $this->hasPickupPoints;
215 }
216
217 /**
218 * Gets carrier hasCarrierDirectLabel.
219 *
220 * @return bool
221 */
222 public function hasDirectLabel(): bool {
223 return $this->hasDirectLabel;
224 }
225
226 /**
227 * Gets carrier separateHouseNumber.
228 *
229 * @return bool
230 */
231 public function requiresSeparateHouseNumber(): bool {
232 return $this->requiresSeparateHouseNumber;
233 }
234
235 /**
236 * Gets carrier customsDeclarations.
237 *
238 * @return bool
239 */
240 public function requiresCustomsDeclarations(): bool {
241 return $this->requiresCustomsDeclarations;
242 }
243
244 /**
245 * Gets carrier requiresEmail.
246 *
247 * @return bool
248 */
249 public function requiresEmail(): bool {
250 return $this->requiresEmail;
251 }
252
253 /**
254 * Gets carrier requiresPhone.
255 *
256 * @return bool
257 */
258 public function requiresPhone(): bool {
259 return $this->requiresPhone;
260 }
261
262 /**
263 * Gets carrier requiresSize.
264 *
265 * @return bool
266 */
267 public function requiresSize(): bool {
268 return $this->requiresSize;
269 }
270
271 /**
272 * Gets carrier supportsCod.
273 *
274 * @return bool
275 */
276 public function supportsCod(): bool {
277 return $this->supportsCod;
278 }
279
280 /**
281 * Gets carrier country.
282 *
283 * @return string
284 */
285 public function getCountry(): string {
286 return $this->country;
287 }
288
289 /**
290 * Gets carrier currency.
291 *
292 * @return string
293 */
294 public function getCurrency(): string {
295 return $this->currency;
296 }
297
298 /**
299 * Gets carrier maxWeight.
300 *
301 * @return float
302 */
303 public function getMaxWeight(): float {
304 return $this->maxWeight;
305 }
306
307 /**
308 * Gets carrier isDeleted.
309 *
310 * @return bool
311 */
312 public function isDeleted(): bool {
313 return $this->isDeleted;
314 }
315
316 /**
317 * Tells if allows age verification.
318 *
319 * @return bool
320 */
321 public function supportsAgeVerification(): bool {
322 return $this->ageVerification;
323 }
324 }
325