commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
TaxRateDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class TaxRateDraftBuilder implements Builder
22{
27 private $name;
28
33 private $amount;
34
39 private $includedInPrice;
40
45 private $country;
46
51 private $state;
52
57 private $subRates;
58
63 private $key;
64
69 private $taxRoundingTarget;
70
77 public function getName()
78 {
79 return $this->name;
80 }
81
89 public function getAmount()
90 {
91 return $this->amount;
92 }
93
100 public function getIncludedInPrice()
101 {
102 return $this->includedInPrice;
103 }
104
112 public function getCountry()
113 {
114 return $this->country;
115 }
116
126 public function getState()
127 {
128 return $this->state;
129 }
130
138 public function getSubRates()
139 {
140 return $this->subRates;
141 }
142
150 public function getKey()
151 {
152 return $this->key;
153 }
154
161 public function getTaxRoundingTarget()
162 {
163 return $this->taxRoundingTarget;
164 }
165
170 public function withName(?string $name)
171 {
172 $this->name = $name;
173
174 return $this;
175 }
176
181 public function withAmount(?float $amount)
182 {
183 $this->amount = $amount;
184
185 return $this;
186 }
187
192 public function withIncludedInPrice(?bool $includedInPrice)
193 {
194 $this->includedInPrice = $includedInPrice;
195
196 return $this;
197 }
198
203 public function withCountry(?string $country)
204 {
205 $this->country = $country;
206
207 return $this;
208 }
209
214 public function withState(?string $state)
215 {
216 $this->state = $state;
217
218 return $this;
219 }
220
225 public function withSubRates(?SubRateCollection $subRates)
226 {
227 $this->subRates = $subRates;
228
229 return $this;
230 }
231
236 public function withKey(?string $key)
237 {
238 $this->key = $key;
239
240 return $this;
241 }
242
247 public function withTaxRoundingTarget(?string $taxRoundingTarget)
248 {
249 $this->taxRoundingTarget = $taxRoundingTarget;
250
251 return $this;
252 }
253
254
255 public function build(): TaxRateDraft
256 {
257 return new TaxRateDraftModel(
258 $this->name,
259 $this->amount,
260 $this->includedInPrice,
261 $this->country,
262 $this->state,
263 $this->subRates,
264 $this->key,
265 $this->taxRoundingTarget
266 );
267 }
268
269 public static function of(): TaxRateDraftBuilder
270 {
271 return new self();
272 }
273}