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
335 public function getDiscounted()
336 {
337 return $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted;
338 }
339
346 public function getCustom()
347 {
348 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
349 }
350
357 public function getStaged()
358 {
359 return $this->staged instanceof StagedStandalonePriceBuilder ? $this->staged->build() : $this->staged;
360 }
361
369 public function getActive()
370 {
371 return $this->active;
372 }
373
380 public function getRecurrencePolicy()
381 {
382 return $this->recurrencePolicy instanceof RecurrencePolicyReferenceBuilder ? $this->recurrencePolicy->build() : $this->recurrencePolicy;
383 }
384
389 public function withId(?string $id)
390 {
391 $this->id = $id;
392
393 return $this;
394 }
395
400 public function withVersion(?int $version)
401 {
402 $this->version = $version;
403
404 return $this;
405 }
406
411 public function withCreatedAt(?DateTimeImmutable $createdAt)
412 {
413 $this->createdAt = $createdAt;
414
415 return $this;
416 }
417
422 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
423 {
424 $this->lastModifiedAt = $lastModifiedAt;
425
426 return $this;
427 }
428
433 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
434 {
435 $this->lastModifiedBy = $lastModifiedBy;
436
437 return $this;
438 }
439
444 public function withCreatedBy(?CreatedBy $createdBy)
445 {
446 $this->createdBy = $createdBy;
447
448 return $this;
449 }
450
455 public function withKey(?string $key)
456 {
457 $this->key = $key;
458
459 return $this;
460 }
461
466 public function withSku(?string $sku)
467 {
468 $this->sku = $sku;
469
470 return $this;
471 }
472
477 public function withValue(?TypedMoney $value)
478 {
479 $this->value = $value;
480
481 return $this;
482 }
483
488 public function withCountry(?string $country)
489 {
490 $this->country = $country;
491
492 return $this;
493 }
494
499 public function withCustomerGroup(?CustomerGroupReference $customerGroup)
500 {
501 $this->customerGroup = $customerGroup;
502
503 return $this;
504 }
505
510 public function withChannel(?ChannelReference $channel)
511 {
512 $this->channel = $channel;
513
514 return $this;
515 }
516
521 public function withValidFrom(?DateTimeImmutable $validFrom)
522 {
523 $this->validFrom = $validFrom;
524
525 return $this;
526 }
527
532 public function withValidUntil(?DateTimeImmutable $validUntil)
533 {
534 $this->validUntil = $validUntil;
535
536 return $this;
537 }
538
543 public function withTiers(?PriceTierCollection $tiers)
544 {
545 $this->tiers = $tiers;
546
547 return $this;
548 }
549
554 public function withDiscounted(?DiscountedPrice $discounted)
555 {
556 $this->discounted = $discounted;
557
558 return $this;
559 }
560
565 public function withCustom(?CustomFields $custom)
566 {
567 $this->custom = $custom;
568
569 return $this;
570 }
571
576 public function withStaged(?StagedStandalonePrice $staged)
577 {
578 $this->staged = $staged;
579
580 return $this;
581 }
582
587 public function withActive(?bool $active)
588 {
589 $this->active = $active;
590
591 return $this;
592 }
593
598 public function withRecurrencePolicy(?RecurrencePolicyReference $recurrencePolicy)
599 {
600 $this->recurrencePolicy = $recurrencePolicy;
601
602 return $this;
603 }
604
609 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
610 {
611 $this->lastModifiedBy = $lastModifiedBy;
612
613 return $this;
614 }
615
620 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
621 {
622 $this->createdBy = $createdBy;
623
624 return $this;
625 }
626
631 public function withValueBuilder(?TypedMoneyBuilder $value)
632 {
633 $this->value = $value;
634
635 return $this;
636 }
637
643 {
644 $this->customerGroup = $customerGroup;
645
646 return $this;
647 }
648
654 {
655 $this->channel = $channel;
656
657 return $this;
658 }
659
664 public function withDiscountedBuilder(?DiscountedPriceBuilder $discounted)
665 {
666 $this->discounted = $discounted;
667
668 return $this;
669 }
670
675 public function withCustomBuilder(?CustomFieldsBuilder $custom)
676 {
677 $this->custom = $custom;
678
679 return $this;
680 }
681
687 {
688 $this->staged = $staged;
689
690 return $this;
691 }
692
698 {
699 $this->recurrencePolicy = $recurrencePolicy;
700
701 return $this;
702 }
703
704 public function build(): StandalonePrice
705 {
706 return new StandalonePriceModel(
707 $this->id,
708 $this->version,
709 $this->createdAt,
710 $this->lastModifiedAt,
711 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
712 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
713 $this->key,
714 $this->sku,
715 $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value,
716 $this->country,
717 $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
718 $this->channel instanceof ChannelReferenceBuilder ? $this->channel->build() : $this->channel,
719 $this->validFrom,
720 $this->validUntil,
721 $this->tiers,
722 $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted,
723 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
724 $this->staged instanceof StagedStandalonePriceBuilder ? $this->staged->build() : $this->staged,
725 $this->active,
726 $this->recurrencePolicy instanceof RecurrencePolicyReferenceBuilder ? $this->recurrencePolicy->build() : $this->recurrencePolicy
727 );
728 }
729
730 public static function of(): StandalonePriceBuilder
731 {
732 return new self();
733 }
734}
withRecurrencePolicy(?RecurrencePolicyReference $recurrencePolicy)
withCustomerGroupBuilder(?CustomerGroupReferenceBuilder $customerGroup)
withRecurrencePolicyBuilder(?RecurrencePolicyReferenceBuilder $recurrencePolicy)