PluginProbe
Packeta / 1.3.0
Packeta v1.3.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.3.0, at src/Packetery/Core/Entity/Carrier.php

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