commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
StandalonePriceBuilder.php
1<?php
2
3declare(strict_types=1);
10
35use DateTimeImmutable;
36use stdClass;
37
41final class StandalonePriceBuilder implements Builder
42{
47 private $id;
48
53 private $version;
54
59 private $createdAt;
60
65 private $lastModifiedAt;
66
71 private $lastModifiedBy;
72
77 private $createdBy;
78
83 private $key;
84
89 private $sku;
90
95 private $value;
96
101 private $country;
102
107 private $customerGroup;
108
113 private $channel;
114
119 private $validFrom;
120
125 private $validUntil;
126
131 private $tiers;
132
137 private $discounted;
138
143 private $custom;
144
149 private $staged;
150
155 private $active;
156
161 private $recurrencePolicy;
162
169 public function getId()
170 {
171 return $this->id;
172 }
173
180 public function getVersion()
181 {
182 return $this->version;
183 }
184
191 public function getCreatedAt()
192 {
193 return $this->createdAt;
194 }
195
202 public function getLastModifiedAt()
203 {
204 return $this->lastModifiedAt;
205 }
206
213 public function getLastModifiedBy()
214 {
215 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
216 }
217
224 public function getCreatedBy()
225 {
226 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
227 }
228
235 public function getKey()
236 {
237 return $this->key;
238 }
239
246 public function getSku()
247 {
248 return $this->sku;
249 }
250
257 public function getValue()
258 {
259 return $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value;
260 }
261
268 public function getCountry()
269 {
270 return $this->country;
271 }
272
279 public function getCustomerGroup()
280 {
281 return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup;
282 }
283
290 public function getChannel()
291 {
292 return $this->channel instanceof ChannelReferenceBuilder ? $this->channel->build() : $this->channel;
293 }
294
301 public function getValidFrom()
302 {
303 return $this->validFrom;
304 }
305
312 public function getValidUntil()
313 {
314 return $this->validUntil;
315 }
316
324 public function getTiers()
325 {
326 return $this->tiers;
327 }
328
337 public function getDiscounted()
338 {
339 return $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted;
340 }
341
348 public function getCustom()
349 {
350 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
351 }
352
359 public function getStaged()
360 {
361 return $this->staged instanceof StagedStandalonePriceBuilder ? $this->staged->build() : $this->staged;
362 }
363
371 public function getActive()
372 {
373 return $this->active;
374 }
375
382 public function getRecurrencePolicy()
383 {
384 return $this->recurrencePolicy instanceof RecurrencePolicyReferenceBuilder ? $this->recurrencePolicy->build() : $this->recurrencePolicy;
385 }
386
391 public function withId(?string $id)
392 {
393 $this->id = $id;
394
395 return $this;
396 }
397
402 public function withVersion(?int $version)
403 {
404 $this->version = $version;
405
406 return $this;
407 }
408
413 public function withCreatedAt(?DateTimeImmutable $createdAt)
414 {
415 $this->createdAt = $createdAt;
416
417 return $this;
418 }
419
424 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
425 {
426 $this->lastModifiedAt = $lastModifiedAt;
427
428 return $this;
429 }
430
435 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
436 {
437 $this->lastModifiedBy = $lastModifiedBy;
438
439 return $this;
440 }
441
446 public function withCreatedBy(?CreatedBy $createdBy)
447 {
448 $this->createdBy = $createdBy;
449
450 return $this;
451 }
452
457 public function withKey(?string $key)
458 {
459 $this->key = $key;
460
461 return $this;
462 }
463
468 public function withSku(?string $sku)
469 {
470 $this->sku = $sku;
471
472 return $this;
473 }
474
479 public function withValue(?TypedMoney $value)
480 {
481 $this->value = $value;
482
483 return $this;
484 }
485
490 public function withCountry(?string $country)
491 {
492 $this->country = $country;
493
494 return $this;
495 }
496
501 public function withCustomerGroup(?CustomerGroupReference $customerGroup)
502 {
503 $this->customerGroup = $customerGroup;
504
505 return $this;
506 }
507
512 public function withChannel(?ChannelReference $channel)
513 {
514 $this->channel = $channel;
515
516 return $this;
517 }
518
523 public function withValidFrom(?DateTimeImmutable $validFrom)
524 {
525 $this->validFrom = $validFrom;
526
527 return $this;
528 }
529
534 public function withValidUntil(?DateTimeImmutable $validUntil)
535 {
536 $this->validUntil = $validUntil;
537
538 return $this;
539 }
540
545 public function withTiers(?PriceTierCollection $tiers)
546 {
547 $this->tiers = $tiers;
548
549 return $this;
550 }
551
556 public function withDiscounted(?DiscountedPrice $discounted)
557 {
558 $this->discounted = $discounted;
559
560 return $this;
561 }
562
567 public function withCustom(?CustomFields $custom)
568 {
569 $this->custom = $custom;
570
571 return $this;
572 }
573
578 public function withStaged(?StagedStandalonePrice $staged)
579 {
580 $this->staged = $staged;
581
582 return $this;
583 }
584
589 public function withActive(?bool $active)
590 {
591 $this->active = $active;
592
593 return $this;
594 }
595
600 public function withRecurrencePolicy(?RecurrencePolicyReference $recurrencePolicy)
601 {
602 $this->recurrencePolicy = $recurrencePolicy;
603
604 return $this;
605 }
606
611 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
612 {
613 $this->lastModifiedBy = $lastModifiedBy;
614
615 return $this;
616 }
617
622 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
623 {
624 $this->createdBy = $createdBy;
625
626 return $this;
627 }
628
633 public function withValueBuilder(?TypedMoneyBuilder $value)
634 {
635 $this->value = $value;
636
637 return $this;
638 }
639
645 {
646 $this->customerGroup = $customerGroup;
647
648 return $this;
649 }
650
656 {
657 $this->channel = $channel;
658
659 return $this;
660 }
661
666 public function withDiscountedBuilder(?DiscountedPriceBuilder $discounted)
667 {
668 $this->discounted = $discounted;
669
670 return $this;
671 }
672
677 public function withCustomBuilder(?CustomFieldsBuilder $custom)
678 {
679 $this->custom = $custom;
680
681 return $this;
682 }
683
689 {
690 $this->staged = $staged;
691
692 return $this;
693 }
694
700 {
701 $this->recurrencePolicy = $recurrencePolicy;
702
703 return $this;
704 }
705
706 public function build(): StandalonePrice
707 {
708 return new StandalonePriceModel(
709 $this->id,
710 $this->version,
711 $this->createdAt,
712 $this->lastModifiedAt,
713 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
714 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
715 $this->key,
716 $this->sku,
717 $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value,
718 $this->country,
719 $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
720 $this->channel instanceof ChannelReferenceBuilder ? $this->channel->build() : $this->channel,
721 $this->validFrom,
722 $this->validUntil,
723 $this->tiers,
724 $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted,
725 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
726 $this->staged instanceof StagedStandalonePriceBuilder ? $this->staged->build() : $this->staged,
727 $this->active,
728 $this->recurrencePolicy instanceof RecurrencePolicyReferenceBuilder ? $this->recurrencePolicy->build() : $this->recurrencePolicy
729 );
730 }
731
732 public static function of(): StandalonePriceBuilder
733 {
734 return new self();
735 }
736}
withRecurrencePolicy(?RecurrencePolicyReference $recurrencePolicy)
withCustomerGroupBuilder(?CustomerGroupReferenceBuilder $customerGroup)
withRecurrencePolicyBuilder(?RecurrencePolicyReferenceBuilder $recurrencePolicy)