commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ShippingMethodBuilder.php
1<?php
2
3declare(strict_types=1);
10
29use DateTimeImmutable;
30use stdClass;
31
35final class ShippingMethodBuilder implements Builder
36{
41 private $id;
42
47 private $version;
48
53 private $createdAt;
54
59 private $lastModifiedAt;
60
65 private $lastModifiedBy;
66
71 private $createdBy;
72
77 private $key;
78
83 private $name;
84
89 private $localizedName;
90
95 private $description;
96
101 private $localizedDescription;
102
107 private $taxCategory;
108
113 private $zoneRates;
114
119 private $active;
120
125 private $isDefault;
126
131 private $predicate;
132
137 private $custom;
138
143 private $stores;
144
149 private $carrier;
150
157 public function getId()
158 {
159 return $this->id;
160 }
161
168 public function getVersion()
169 {
170 return $this->version;
171 }
172
179 public function getCreatedAt()
180 {
181 return $this->createdAt;
182 }
183
190 public function getLastModifiedAt()
191 {
192 return $this->lastModifiedAt;
193 }
194
201 public function getLastModifiedBy()
202 {
203 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
204 }
205
212 public function getCreatedBy()
213 {
214 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
215 }
216
223 public function getKey()
224 {
225 return $this->key;
226 }
227
234 public function getName()
235 {
236 return $this->name;
237 }
238
245 public function getLocalizedName()
246 {
247 return $this->localizedName instanceof LocalizedStringBuilder ? $this->localizedName->build() : $this->localizedName;
248 }
249
256 public function getDescription()
257 {
258 return $this->description;
259 }
260
267 public function getLocalizedDescription()
268 {
269 return $this->localizedDescription instanceof LocalizedStringBuilder ? $this->localizedDescription->build() : $this->localizedDescription;
270 }
271
278 public function getTaxCategory()
279 {
280 return $this->taxCategory instanceof TaxCategoryReferenceBuilder ? $this->taxCategory->build() : $this->taxCategory;
281 }
282
289 public function getZoneRates()
290 {
291 return $this->zoneRates;
292 }
293
301 public function getActive()
302 {
303 return $this->active;
304 }
305
312 public function getIsDefault()
313 {
314 return $this->isDefault;
315 }
316
323 public function getPredicate()
324 {
325 return $this->predicate;
326 }
327
334 public function getCustom()
335 {
336 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
337 }
338
348 public function getStores()
349 {
350 return $this->stores;
351 }
352
359 public function getCarrier()
360 {
361 return $this->carrier;
362 }
363
368 public function withId(?string $id)
369 {
370 $this->id = $id;
371
372 return $this;
373 }
374
379 public function withVersion(?int $version)
380 {
381 $this->version = $version;
382
383 return $this;
384 }
385
390 public function withCreatedAt(?DateTimeImmutable $createdAt)
391 {
392 $this->createdAt = $createdAt;
393
394 return $this;
395 }
396
401 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
402 {
403 $this->lastModifiedAt = $lastModifiedAt;
404
405 return $this;
406 }
407
412 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
413 {
414 $this->lastModifiedBy = $lastModifiedBy;
415
416 return $this;
417 }
418
423 public function withCreatedBy(?CreatedBy $createdBy)
424 {
425 $this->createdBy = $createdBy;
426
427 return $this;
428 }
429
434 public function withKey(?string $key)
435 {
436 $this->key = $key;
437
438 return $this;
439 }
440
445 public function withName(?string $name)
446 {
447 $this->name = $name;
448
449 return $this;
450 }
451
456 public function withLocalizedName(?LocalizedString $localizedName)
457 {
458 $this->localizedName = $localizedName;
459
460 return $this;
461 }
462
467 public function withDescription(?string $description)
468 {
469 $this->description = $description;
470
471 return $this;
472 }
473
478 public function withLocalizedDescription(?LocalizedString $localizedDescription)
479 {
480 $this->localizedDescription = $localizedDescription;
481
482 return $this;
483 }
484
489 public function withTaxCategory(?TaxCategoryReference $taxCategory)
490 {
491 $this->taxCategory = $taxCategory;
492
493 return $this;
494 }
495
500 public function withZoneRates(?ZoneRateCollection $zoneRates)
501 {
502 $this->zoneRates = $zoneRates;
503
504 return $this;
505 }
506
511 public function withActive(?bool $active)
512 {
513 $this->active = $active;
514
515 return $this;
516 }
517
522 public function withIsDefault(?bool $isDefault)
523 {
524 $this->isDefault = $isDefault;
525
526 return $this;
527 }
528
533 public function withPredicate(?string $predicate)
534 {
535 $this->predicate = $predicate;
536
537 return $this;
538 }
539
544 public function withCustom(?CustomFields $custom)
545 {
546 $this->custom = $custom;
547
548 return $this;
549 }
550
555 public function withStores(?StoreKeyReferenceCollection $stores)
556 {
557 $this->stores = $stores;
558
559 return $this;
560 }
561
566 public function withCarrier(?string $carrier)
567 {
568 $this->carrier = $carrier;
569
570 return $this;
571 }
572
577 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
578 {
579 $this->lastModifiedBy = $lastModifiedBy;
580
581 return $this;
582 }
583
588 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
589 {
590 $this->createdBy = $createdBy;
591
592 return $this;
593 }
594
599 public function withLocalizedNameBuilder(?LocalizedStringBuilder $localizedName)
600 {
601 $this->localizedName = $localizedName;
602
603 return $this;
604 }
605
610 public function withLocalizedDescriptionBuilder(?LocalizedStringBuilder $localizedDescription)
611 {
612 $this->localizedDescription = $localizedDescription;
613
614 return $this;
615 }
616
622 {
623 $this->taxCategory = $taxCategory;
624
625 return $this;
626 }
627
632 public function withCustomBuilder(?CustomFieldsBuilder $custom)
633 {
634 $this->custom = $custom;
635
636 return $this;
637 }
638
639 public function build(): ShippingMethod
640 {
641 return new ShippingMethodModel(
642 $this->id,
643 $this->version,
644 $this->createdAt,
645 $this->lastModifiedAt,
646 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
647 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
648 $this->key,
649 $this->name,
650 $this->localizedName instanceof LocalizedStringBuilder ? $this->localizedName->build() : $this->localizedName,
651 $this->description,
652 $this->localizedDescription instanceof LocalizedStringBuilder ? $this->localizedDescription->build() : $this->localizedDescription,
653 $this->taxCategory instanceof TaxCategoryReferenceBuilder ? $this->taxCategory->build() : $this->taxCategory,
654 $this->zoneRates,
655 $this->active,
656 $this->isDefault,
657 $this->predicate,
658 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
659 $this->stores,
660 $this->carrier
661 );
662 }
663
664 public static function of(): ShippingMethodBuilder
665 {
666 return new self();
667 }
668}
withLocalizedDescriptionBuilder(?LocalizedStringBuilder $localizedDescription)
withTaxCategoryBuilder(?TaxCategoryReferenceBuilder $taxCategory)