commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PriceImportBuilder.php
1<?php
2
3declare(strict_types=1);
10
33use DateTimeImmutable;
34use stdClass;
35
39final class PriceImportBuilder implements Builder
40{
45 private $key;
46
51 private $value;
52
57 private $country;
58
63 private $validFrom;
64
69 private $validUntil;
70
75 private $customerGroup;
76
81 private $channel;
82
87 private $discounted;
88
93 private $staged;
94
99 private $tiers;
100
105 private $custom;
106
111 private $productVariant;
112
117 private $product;
118
125 public function getKey()
126 {
127 return $this->key;
128 }
129
136 public function getValue()
137 {
138 return $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value;
139 }
140
147 public function getCountry()
148 {
149 return $this->country;
150 }
151
158 public function getValidFrom()
159 {
160 return $this->validFrom;
161 }
162
169 public function getValidUntil()
170 {
171 return $this->validUntil;
172 }
173
180 public function getCustomerGroup()
181 {
182 return $this->customerGroup instanceof CustomerGroupKeyReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup;
183 }
184
191 public function getChannel()
192 {
193 return $this->channel instanceof ChannelKeyReferenceBuilder ? $this->channel->build() : $this->channel;
194 }
195
202 public function getDiscounted()
203 {
204 return $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted;
205 }
206
216 public function getStaged()
217 {
218 return $this->staged;
219 }
220
227 public function getTiers()
228 {
229 return $this->tiers;
230 }
231
238 public function getCustom()
239 {
240 return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom;
241 }
242
249 public function getProductVariant()
250 {
251 return $this->productVariant instanceof ProductVariantKeyReferenceBuilder ? $this->productVariant->build() : $this->productVariant;
252 }
253
260 public function getProduct()
261 {
262 return $this->product instanceof ProductKeyReferenceBuilder ? $this->product->build() : $this->product;
263 }
264
269 public function withKey(?string $key)
270 {
271 $this->key = $key;
272
273 return $this;
274 }
275
280 public function withValue(?TypedMoney $value)
281 {
282 $this->value = $value;
283
284 return $this;
285 }
286
291 public function withCountry(?string $country)
292 {
293 $this->country = $country;
294
295 return $this;
296 }
297
302 public function withValidFrom(?DateTimeImmutable $validFrom)
303 {
304 $this->validFrom = $validFrom;
305
306 return $this;
307 }
308
313 public function withValidUntil(?DateTimeImmutable $validUntil)
314 {
315 $this->validUntil = $validUntil;
316
317 return $this;
318 }
319
324 public function withCustomerGroup(?CustomerGroupKeyReference $customerGroup)
325 {
326 $this->customerGroup = $customerGroup;
327
328 return $this;
329 }
330
335 public function withChannel(?ChannelKeyReference $channel)
336 {
337 $this->channel = $channel;
338
339 return $this;
340 }
341
346 public function withDiscounted(?DiscountedPrice $discounted)
347 {
348 $this->discounted = $discounted;
349
350 return $this;
351 }
352
357 public function withStaged(?bool $staged)
358 {
359 $this->staged = $staged;
360
361 return $this;
362 }
363
368 public function withTiers(?PriceTierCollection $tiers)
369 {
370 $this->tiers = $tiers;
371
372 return $this;
373 }
374
379 public function withCustom(?Custom $custom)
380 {
381 $this->custom = $custom;
382
383 return $this;
384 }
385
390 public function withProductVariant(?ProductVariantKeyReference $productVariant)
391 {
392 $this->productVariant = $productVariant;
393
394 return $this;
395 }
396
401 public function withProduct(?ProductKeyReference $product)
402 {
403 $this->product = $product;
404
405 return $this;
406 }
407
412 public function withValueBuilder(?TypedMoneyBuilder $value)
413 {
414 $this->value = $value;
415
416 return $this;
417 }
418
424 {
425 $this->customerGroup = $customerGroup;
426
427 return $this;
428 }
429
435 {
436 $this->channel = $channel;
437
438 return $this;
439 }
440
445 public function withDiscountedBuilder(?DiscountedPriceBuilder $discounted)
446 {
447 $this->discounted = $discounted;
448
449 return $this;
450 }
451
456 public function withCustomBuilder(?CustomBuilder $custom)
457 {
458 $this->custom = $custom;
459
460 return $this;
461 }
462
468 {
469 $this->productVariant = $productVariant;
470
471 return $this;
472 }
473
479 {
480 $this->product = $product;
481
482 return $this;
483 }
484
485 public function build(): PriceImport
486 {
487 return new PriceImportModel(
488 $this->key,
489 $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value,
490 $this->country,
491 $this->validFrom,
492 $this->validUntil,
493 $this->customerGroup instanceof CustomerGroupKeyReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
494 $this->channel instanceof ChannelKeyReferenceBuilder ? $this->channel->build() : $this->channel,
495 $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted,
496 $this->staged,
497 $this->tiers,
498 $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom,
499 $this->productVariant instanceof ProductVariantKeyReferenceBuilder ? $this->productVariant->build() : $this->productVariant,
500 $this->product instanceof ProductKeyReferenceBuilder ? $this->product->build() : $this->product
501 );
502 }
503
504 public static function of(): PriceImportBuilder
505 {
506 return new self();
507 }
508}
withChannelBuilder(?ChannelKeyReferenceBuilder $channel)
withProductVariantBuilder(?ProductVariantKeyReferenceBuilder $productVariant)
withCustomerGroupBuilder(?CustomerGroupKeyReferenceBuilder $customerGroup)
withDiscountedBuilder(?DiscountedPriceBuilder $discounted)
withProductVariant(?ProductVariantKeyReference $productVariant)
withProductBuilder(?ProductKeyReferenceBuilder $product)
withCustomerGroup(?CustomerGroupKeyReference $customerGroup)