commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
RecurringOrderBuilder.php
1<?php
2
3declare(strict_types=1);
10
38use DateTimeImmutable;
39use stdClass;
40
44final class RecurringOrderBuilder implements Builder
45{
50 private $id;
51
56 private $version;
57
62 private $createdAt;
63
68 private $lastModifiedAt;
69
74 private $key;
75
80 private $cart;
81
86 private $originOrder;
87
92 private $startsAt;
93
98 private $resumesAt;
99
104 private $expiresAt;
105
110 private $lastOrderAt;
111
116 private $nextOrderAt;
117
122 private $skipConfiguration;
123
128 private $store;
129
134 private $businessUnit;
135
140 private $state;
141
146 private $recurringOrderState;
147
152 private $schedule;
153
158 private $customer;
159
164 private $customerEmail;
165
170 private $custom;
171
176 private $lastModifiedBy;
177
182 private $createdBy;
183
190 public function getId()
191 {
192 return $this->id;
193 }
194
201 public function getVersion()
202 {
203 return $this->version;
204 }
205
212 public function getCreatedAt()
213 {
214 return $this->createdAt;
215 }
216
223 public function getLastModifiedAt()
224 {
225 return $this->lastModifiedAt;
226 }
227
234 public function getKey()
235 {
236 return $this->key;
237 }
238
246 public function getCart()
247 {
248 return $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart;
249 }
250
257 public function getOriginOrder()
258 {
259 return $this->originOrder instanceof OrderReferenceBuilder ? $this->originOrder->build() : $this->originOrder;
260 }
261
268 public function getStartsAt()
269 {
270 return $this->startsAt;
271 }
272
279 public function getResumesAt()
280 {
281 return $this->resumesAt;
282 }
283
290 public function getExpiresAt()
291 {
292 return $this->expiresAt;
293 }
294
301 public function getLastOrderAt()
302 {
303 return $this->lastOrderAt;
304 }
305
312 public function getNextOrderAt()
313 {
314 return $this->nextOrderAt;
315 }
316
323 public function getSkipConfiguration()
324 {
325 return $this->skipConfiguration instanceof SkipConfigurationBuilder ? $this->skipConfiguration->build() : $this->skipConfiguration;
326 }
327
334 public function getStore()
335 {
336 return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store;
337 }
338
345 public function getBusinessUnit()
346 {
347 return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit;
348 }
349
356 public function getState()
357 {
358 return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
359 }
360
367 public function getRecurringOrderState()
368 {
369 return $this->recurringOrderState;
370 }
371
378 public function getSchedule()
379 {
380 return $this->schedule instanceof RecurrencePolicyScheduleBuilder ? $this->schedule->build() : $this->schedule;
381 }
382
389 public function getCustomer()
390 {
391 return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer;
392 }
393
400 public function getCustomerEmail()
401 {
402 return $this->customerEmail;
403 }
404
411 public function getCustom()
412 {
413 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
414 }
415
422 public function getLastModifiedBy()
423 {
424 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
425 }
426
433 public function getCreatedBy()
434 {
435 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
436 }
437
442 public function withId(?string $id)
443 {
444 $this->id = $id;
445
446 return $this;
447 }
448
453 public function withVersion(?int $version)
454 {
455 $this->version = $version;
456
457 return $this;
458 }
459
464 public function withCreatedAt(?DateTimeImmutable $createdAt)
465 {
466 $this->createdAt = $createdAt;
467
468 return $this;
469 }
470
475 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
476 {
477 $this->lastModifiedAt = $lastModifiedAt;
478
479 return $this;
480 }
481
486 public function withKey(?string $key)
487 {
488 $this->key = $key;
489
490 return $this;
491 }
492
497 public function withCart(?CartReference $cart)
498 {
499 $this->cart = $cart;
500
501 return $this;
502 }
503
508 public function withOriginOrder(?OrderReference $originOrder)
509 {
510 $this->originOrder = $originOrder;
511
512 return $this;
513 }
514
519 public function withStartsAt(?DateTimeImmutable $startsAt)
520 {
521 $this->startsAt = $startsAt;
522
523 return $this;
524 }
525
530 public function withResumesAt(?DateTimeImmutable $resumesAt)
531 {
532 $this->resumesAt = $resumesAt;
533
534 return $this;
535 }
536
541 public function withExpiresAt(?DateTimeImmutable $expiresAt)
542 {
543 $this->expiresAt = $expiresAt;
544
545 return $this;
546 }
547
552 public function withLastOrderAt(?DateTimeImmutable $lastOrderAt)
553 {
554 $this->lastOrderAt = $lastOrderAt;
555
556 return $this;
557 }
558
563 public function withNextOrderAt(?DateTimeImmutable $nextOrderAt)
564 {
565 $this->nextOrderAt = $nextOrderAt;
566
567 return $this;
568 }
569
574 public function withSkipConfiguration(?SkipConfiguration $skipConfiguration)
575 {
576 $this->skipConfiguration = $skipConfiguration;
577
578 return $this;
579 }
580
585 public function withStore(?StoreKeyReference $store)
586 {
587 $this->store = $store;
588
589 return $this;
590 }
591
596 public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit)
597 {
598 $this->businessUnit = $businessUnit;
599
600 return $this;
601 }
602
607 public function withState(?StateReference $state)
608 {
609 $this->state = $state;
610
611 return $this;
612 }
613
618 public function withRecurringOrderState(?string $recurringOrderState)
619 {
620 $this->recurringOrderState = $recurringOrderState;
621
622 return $this;
623 }
624
629 public function withSchedule(?RecurrencePolicySchedule $schedule)
630 {
631 $this->schedule = $schedule;
632
633 return $this;
634 }
635
640 public function withCustomer(?CustomerReference $customer)
641 {
642 $this->customer = $customer;
643
644 return $this;
645 }
646
651 public function withCustomerEmail(?string $customerEmail)
652 {
653 $this->customerEmail = $customerEmail;
654
655 return $this;
656 }
657
662 public function withCustom(?CustomFields $custom)
663 {
664 $this->custom = $custom;
665
666 return $this;
667 }
668
673 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
674 {
675 $this->lastModifiedBy = $lastModifiedBy;
676
677 return $this;
678 }
679
684 public function withCreatedBy(?CreatedBy $createdBy)
685 {
686 $this->createdBy = $createdBy;
687
688 return $this;
689 }
690
695 public function withCartBuilder(?CartReferenceBuilder $cart)
696 {
697 $this->cart = $cart;
698
699 return $this;
700 }
701
706 public function withOriginOrderBuilder(?OrderReferenceBuilder $originOrder)
707 {
708 $this->originOrder = $originOrder;
709
710 return $this;
711 }
712
717 public function withSkipConfigurationBuilder(?SkipConfigurationBuilder $skipConfiguration)
718 {
719 $this->skipConfiguration = $skipConfiguration;
720
721 return $this;
722 }
723
729 {
730 $this->store = $store;
731
732 return $this;
733 }
734
740 {
741 $this->businessUnit = $businessUnit;
742
743 return $this;
744 }
745
751 {
752 $this->state = $state;
753
754 return $this;
755 }
756
762 {
763 $this->schedule = $schedule;
764
765 return $this;
766 }
767
773 {
774 $this->customer = $customer;
775
776 return $this;
777 }
778
783 public function withCustomBuilder(?CustomFieldsBuilder $custom)
784 {
785 $this->custom = $custom;
786
787 return $this;
788 }
789
794 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
795 {
796 $this->lastModifiedBy = $lastModifiedBy;
797
798 return $this;
799 }
800
805 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
806 {
807 $this->createdBy = $createdBy;
808
809 return $this;
810 }
811
812 public function build(): RecurringOrder
813 {
814 return new RecurringOrderModel(
815 $this->id,
816 $this->version,
817 $this->createdAt,
818 $this->lastModifiedAt,
819 $this->key,
820 $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart,
821 $this->originOrder instanceof OrderReferenceBuilder ? $this->originOrder->build() : $this->originOrder,
822 $this->startsAt,
823 $this->resumesAt,
824 $this->expiresAt,
825 $this->lastOrderAt,
826 $this->nextOrderAt,
827 $this->skipConfiguration instanceof SkipConfigurationBuilder ? $this->skipConfiguration->build() : $this->skipConfiguration,
828 $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store,
829 $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit,
830 $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state,
831 $this->recurringOrderState,
832 $this->schedule instanceof RecurrencePolicyScheduleBuilder ? $this->schedule->build() : $this->schedule,
833 $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer,
834 $this->customerEmail,
835 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
836 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
837 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy
838 );
839 }
840
841 public static function of(): RecurringOrderBuilder
842 {
843 return new self();
844 }
845}
withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit)
withSkipConfigurationBuilder(?SkipConfigurationBuilder $skipConfiguration)
withScheduleBuilder(?RecurrencePolicyScheduleBuilder $schedule)