commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ZoneRateDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
23final class ZoneRateDraftBuilder implements Builder
24{
29 private $zone;
30
35 private $shippingRates;
36
43 public function getZone()
44 {
45 return $this->zone instanceof ZoneResourceIdentifierBuilder ? $this->zone->build() : $this->zone;
46 }
47
54 public function getShippingRates()
55 {
56 return $this->shippingRates;
57 }
58
63 public function withZone(?ZoneResourceIdentifier $zone)
64 {
65 $this->zone = $zone;
66
67 return $this;
68 }
69
74 public function withShippingRates(?ShippingRateDraftCollection $shippingRates)
75 {
76 $this->shippingRates = $shippingRates;
77
78 return $this;
79 }
80
86 {
87 $this->zone = $zone;
88
89 return $this;
90 }
91
92 public function build(): ZoneRateDraft
93 {
94 return new ZoneRateDraftModel(
95 $this->zone instanceof ZoneResourceIdentifierBuilder ? $this->zone->build() : $this->zone,
96 $this->shippingRates
97 );
98 }
99
100 public static function of(): ZoneRateDraftBuilder
101 {
102 return new self();
103 }
104}
withShippingRates(?ShippingRateDraftCollection $shippingRates)