commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ShippingMethodDraftModel.php
1<?php
2
3declare(strict_types=1);
10
22use stdClass;
23
28{
33 protected $key;
34
39 protected $name;
40
45 protected $localizedName;
46
51 protected $description;
52
58
63 protected $taxCategory;
64
69 protected $zoneRates;
70
75 protected $active;
76
81 protected $isDefault;
82
87 protected $predicate;
88
93 protected $custom;
94
99 protected $stores;
100
105 protected $carrier;
106
107
111 public function __construct(
112 ?string $key = null,
113 ?string $name = null,
115 ?string $description = null,
119 ?bool $active = null,
120 ?bool $isDefault = null,
121 ?string $predicate = null,
124 ?string $carrier = null
125 ) {
126 $this->key = $key;
127 $this->name = $name;
128 $this->localizedName = $localizedName;
129 $this->description = $description;
130 $this->localizedDescription = $localizedDescription;
131 $this->taxCategory = $taxCategory;
132 $this->zoneRates = $zoneRates;
133 $this->active = $active;
134 $this->isDefault = $isDefault;
135 $this->predicate = $predicate;
136 $this->custom = $custom;
137 $this->stores = $stores;
138 $this->carrier = $carrier;
139 }
140
147 public function getKey()
148 {
149 if (is_null($this->key)) {
151 $data = $this->raw(self::FIELD_KEY);
152 if (is_null($data)) {
153 return null;
154 }
155 $this->key = (string) $data;
156 }
157
158 return $this->key;
159 }
160
167 public function getName()
168 {
169 if (is_null($this->name)) {
171 $data = $this->raw(self::FIELD_NAME);
172 if (is_null($data)) {
173 return null;
174 }
175 $this->name = (string) $data;
176 }
177
178 return $this->name;
179 }
180
187 public function getLocalizedName()
188 {
189 if (is_null($this->localizedName)) {
191 $data = $this->raw(self::FIELD_LOCALIZED_NAME);
192 if (is_null($data)) {
193 return null;
194 }
195
196 $this->localizedName = LocalizedStringModel::of($data);
197 }
198
200 }
201
208 public function getDescription()
209 {
210 if (is_null($this->description)) {
212 $data = $this->raw(self::FIELD_DESCRIPTION);
213 if (is_null($data)) {
214 return null;
215 }
216 $this->description = (string) $data;
217 }
218
219 return $this->description;
220 }
221
228 public function getLocalizedDescription()
229 {
230 if (is_null($this->localizedDescription)) {
232 $data = $this->raw(self::FIELD_LOCALIZED_DESCRIPTION);
233 if (is_null($data)) {
234 return null;
235 }
236
237 $this->localizedDescription = LocalizedStringModel::of($data);
238 }
239
241 }
242
249 public function getTaxCategory()
250 {
251 if (is_null($this->taxCategory)) {
253 $data = $this->raw(self::FIELD_TAX_CATEGORY);
254 if (is_null($data)) {
255 return null;
256 }
257
258 $this->taxCategory = TaxCategoryResourceIdentifierModel::of($data);
259 }
260
261 return $this->taxCategory;
262 }
263
270 public function getZoneRates()
271 {
272 if (is_null($this->zoneRates)) {
274 $data = $this->raw(self::FIELD_ZONE_RATES);
275 if (is_null($data)) {
276 return null;
277 }
278 $this->zoneRates = ZoneRateDraftCollection::fromArray($data);
279 }
280
281 return $this->zoneRates;
282 }
283
290 public function getActive()
291 {
292 if (is_null($this->active)) {
294 $data = $this->raw(self::FIELD_ACTIVE);
295 if (is_null($data)) {
296 return null;
297 }
298 $this->active = (bool) $data;
299 }
300
301 return $this->active;
302 }
303
310 public function getIsDefault()
311 {
312 if (is_null($this->isDefault)) {
314 $data = $this->raw(self::FIELD_IS_DEFAULT);
315 if (is_null($data)) {
316 return null;
317 }
318 $this->isDefault = (bool) $data;
319 }
320
321 return $this->isDefault;
322 }
323
330 public function getPredicate()
331 {
332 if (is_null($this->predicate)) {
334 $data = $this->raw(self::FIELD_PREDICATE);
335 if (is_null($data)) {
336 return null;
337 }
338 $this->predicate = (string) $data;
339 }
340
341 return $this->predicate;
342 }
343
350 public function getCustom()
351 {
352 if (is_null($this->custom)) {
354 $data = $this->raw(self::FIELD_CUSTOM);
355 if (is_null($data)) {
356 return null;
357 }
358
359 $this->custom = CustomFieldsDraftModel::of($data);
360 }
361
362 return $this->custom;
363 }
364
375 public function getStores()
376 {
377 if (is_null($this->stores)) {
379 $data = $this->raw(self::FIELD_STORES);
380 if (is_null($data)) {
381 return null;
382 }
383 $this->stores = StoreResourceIdentifierCollection::fromArray($data);
384 }
385
386 return $this->stores;
387 }
388
395 public function getCarrier()
396 {
397 if (is_null($this->carrier)) {
399 $data = $this->raw(self::FIELD_CARRIER);
400 if (is_null($data)) {
401 return null;
402 }
403 $this->carrier = (string) $data;
404 }
405
406 return $this->carrier;
407 }
408
409
413 public function setKey(?string $key): void
414 {
415 $this->key = $key;
416 }
417
421 public function setName(?string $name): void
422 {
423 $this->name = $name;
424 }
425
430 {
431 $this->localizedName = $localizedName;
432 }
433
437 public function setDescription(?string $description): void
438 {
439 $this->description = $description;
440 }
441
446 {
447 $this->localizedDescription = $localizedDescription;
448 }
449
454 {
455 $this->taxCategory = $taxCategory;
456 }
457
462 {
463 $this->zoneRates = $zoneRates;
464 }
465
469 public function setActive(?bool $active): void
470 {
471 $this->active = $active;
472 }
473
477 public function setIsDefault(?bool $isDefault): void
478 {
479 $this->isDefault = $isDefault;
480 }
481
485 public function setPredicate(?string $predicate): void
486 {
487 $this->predicate = $predicate;
488 }
489
493 public function setCustom(?CustomFieldsDraft $custom): void
494 {
495 $this->custom = $custom;
496 }
497
502 {
503 $this->stores = $stores;
504 }
505
509 public function setCarrier(?string $carrier): void
510 {
511 $this->carrier = $carrier;
512 }
513}
__construct(?string $key=null, ?string $name=null, ?LocalizedString $localizedName=null, ?string $description=null, ?LocalizedString $localizedDescription=null, ?TaxCategoryResourceIdentifier $taxCategory=null, ?ZoneRateDraftCollection $zoneRates=null, ?bool $active=null, ?bool $isDefault=null, ?string $predicate=null, ?CustomFieldsDraft $custom=null, ?StoreResourceIdentifierCollection $stores=null, ?string $carrier=null)
static fromArray(array $data)