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
259 public function getOriginOrder()
260 {
261 return $this->originOrder instanceof OrderReferenceBuilder ? $this->originOrder->build() : $this->originOrder;
262 }
263
270 public function getStartsAt()
271 {
272 return $this->startsAt;
273 }
274
281 public function getResumesAt()
282 {
283 return $this->resumesAt;
284 }
285
292 public function getExpiresAt()
293 {
294 return $this->expiresAt;
295 }
296
303 public function getLastOrderAt()
304 {
305 return $this->lastOrderAt;
306 }
307
314 public function getNextOrderAt()
315 {
316 return $this->nextOrderAt;
317 }
318
325 public function getSkipConfiguration()
326 {
327 return $this->skipConfiguration instanceof SkipConfigurationBuilder ? $this->skipConfiguration->build() : $this->skipConfiguration;
328 }
329
336 public function getStore()
337 {
338 return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store;
339 }
340
347 public function getBusinessUnit()
348 {
349 return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit;
350 }
351
358 public function getState()
359 {
360 return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
361 }
362
369 public function getRecurringOrderState()
370 {
371 return $this->recurringOrderState;
372 }
373
380 public function getSchedule()
381 {
382 return $this->schedule instanceof RecurrencePolicyScheduleBuilder ? $this->schedule->build() : $this->schedule;
383 }
384
391 public function getCustomer()
392 {
393 return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer;
394 }
395
402 public function getCustomerEmail()
403 {
404 return $this->customerEmail;
405 }
406
413 public function getCustom()
414 {
415 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
416 }
417
424 public function getLastModifiedBy()
425 {
426 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
427 }
428
435 public function getCreatedBy()
436 {
437 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
438 }
439
444 public function withId(?string $id)
445 {
446 $this->id = $id;
447
448 return $this;
449 }
450
455 public function withVersion(?int $version)
456 {
457 $this->version = $version;
458
459 return $this;
460 }
461
466 public function withCreatedAt(?DateTimeImmutable $createdAt)
467 {
468 $this->createdAt = $createdAt;
469
470 return $this;
471 }
472
477 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
478 {
479 $this->lastModifiedAt = $lastModifiedAt;
480
481 return $this;
482 }
483
488 public function withKey(?string $key)
489 {
490 $this->key = $key;
491
492 return $this;
493 }
494
499 public function withCart(?CartReference $cart)
500 {
501 $this->cart = $cart;
502
503 return $this;
504 }
505
510 public function withOriginOrder(?OrderReference $originOrder)
511 {
512 $this->originOrder = $originOrder;
513
514 return $this;
515 }
516
521 public function withStartsAt(?DateTimeImmutable $startsAt)
522 {
523 $this->startsAt = $startsAt;
524
525 return $this;
526 }
527
532 public function withResumesAt(?DateTimeImmutable $resumesAt)
533 {
534 $this->resumesAt = $resumesAt;
535
536 return $this;
537 }
538
543 public function withExpiresAt(?DateTimeImmutable $expiresAt)
544 {
545 $this->expiresAt = $expiresAt;
546
547 return $this;
548 }
549
554 public function withLastOrderAt(?DateTimeImmutable $lastOrderAt)
555 {
556 $this->lastOrderAt = $lastOrderAt;
557
558 return $this;
559 }
560
565 public function withNextOrderAt(?DateTimeImmutable $nextOrderAt)
566 {
567 $this->nextOrderAt = $nextOrderAt;
568
569 return $this;
570 }
571
576 public function withSkipConfiguration(?SkipConfiguration $skipConfiguration)
577 {
578 $this->skipConfiguration = $skipConfiguration;
579
580 return $this;
581 }
582
587 public function withStore(?StoreKeyReference $store)
588 {
589 $this->store = $store;
590
591 return $this;
592 }
593
598 public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit)
599 {
600 $this->businessUnit = $businessUnit;
601
602 return $this;
603 }
604
609 public function withState(?StateReference $state)
610 {
611 $this->state = $state;
612
613 return $this;
614 }
615
620 public function withRecurringOrderState(?string $recurringOrderState)
621 {
622 $this->recurringOrderState = $recurringOrderState;
623
624 return $this;
625 }
626
631 public function withSchedule(?RecurrencePolicySchedule $schedule)
632 {
633 $this->schedule = $schedule;
634
635 return $this;
636 }
637
642 public function withCustomer(?CustomerReference $customer)
643 {
644 $this->customer = $customer;
645
646 return $this;
647 }
648
653 public function withCustomerEmail(?string $customerEmail)
654 {
655 $this->customerEmail = $customerEmail;
656
657 return $this;
658 }
659
664 public function withCustom(?CustomFields $custom)
665 {
666 $this->custom = $custom;
667
668 return $this;
669 }
670
675 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
676 {
677 $this->lastModifiedBy = $lastModifiedBy;
678
679 return $this;
680 }
681
686 public function withCreatedBy(?CreatedBy $createdBy)
687 {
688 $this->createdBy = $createdBy;
689
690 return $this;
691 }
692
697 public function withCartBuilder(?CartReferenceBuilder $cart)
698 {
699 $this->cart = $cart;
700
701 return $this;
702 }
703
708 public function withOriginOrderBuilder(?OrderReferenceBuilder $originOrder)
709 {
710 $this->originOrder = $originOrder;
711
712 return $this;
713 }
714
719 public function withSkipConfigurationBuilder(?SkipConfigurationBuilder $skipConfiguration)
720 {
721 $this->skipConfiguration = $skipConfiguration;
722
723 return $this;
724 }
725
731 {
732 $this->store = $store;
733
734 return $this;
735 }
736
742 {
743 $this->businessUnit = $businessUnit;
744
745 return $this;
746 }
747
753 {
754 $this->state = $state;
755
756 return $this;
757 }
758
764 {
765 $this->schedule = $schedule;
766
767 return $this;
768 }
769
775 {
776 $this->customer = $customer;
777
778 return $this;
779 }
780
785 public function withCustomBuilder(?CustomFieldsBuilder $custom)
786 {
787 $this->custom = $custom;
788
789 return $this;
790 }
791
796 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
797 {
798 $this->lastModifiedBy = $lastModifiedBy;
799
800 return $this;
801 }
802
807 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
808 {
809 $this->createdBy = $createdBy;
810
811 return $this;
812 }
813
814 public function build(): RecurringOrder
815 {
816 return new RecurringOrderModel(
817 $this->id,
818 $this->version,
819 $this->createdAt,
820 $this->lastModifiedAt,
821 $this->key,
822 $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart,
823 $this->originOrder instanceof OrderReferenceBuilder ? $this->originOrder->build() : $this->originOrder,
824 $this->startsAt,
825 $this->resumesAt,
826 $this->expiresAt,
827 $this->lastOrderAt,
828 $this->nextOrderAt,
829 $this->skipConfiguration instanceof SkipConfigurationBuilder ? $this->skipConfiguration->build() : $this->skipConfiguration,
830 $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store,
831 $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit,
832 $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state,
833 $this->recurringOrderState,
834 $this->schedule instanceof RecurrencePolicyScheduleBuilder ? $this->schedule->build() : $this->schedule,
835 $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer,
836 $this->customerEmail,
837 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
838 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
839 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy
840 );
841 }
842
843 public static function of(): RecurringOrderBuilder
844 {
845 return new self();
846 }
847}
withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit)
withSkipConfigurationBuilder(?SkipConfigurationBuilder $skipConfiguration)
withScheduleBuilder(?RecurrencePolicyScheduleBuilder $schedule)