commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
OrderImportDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
33use DateTimeImmutable;
34use stdClass;
35
39final class OrderImportDraftBuilder implements Builder
40{
45 private $orderNumber;
46
51 private $purchaseOrderNumber;
52
57 private $customerId;
58
63 private $customerEmail;
64
69 private $customerGroup;
70
75 private $businessUnit;
76
81 private $store;
82
87 private $lineItems;
88
93 private $customLineItems;
94
99 private $totalPrice;
100
105 private $taxedPrice;
106
111 private $priceRoundingMode;
112
117 private $taxRoundingMode;
118
123 private $taxCalculationMode;
124
129 private $inventoryMode;
130
135 private $billingAddress;
136
141 private $shippingAddress;
142
147 private $itemShippingAddresses;
148
153 private $shippingInfo;
154
159 private $paymentInfo;
160
165 private $paymentState;
166
171 private $shipmentState;
172
177 private $orderState;
178
183 private $state;
184
189 private $country;
190
195 private $origin;
196
201 private $completedAt;
202
207 private $custom;
208
216 public function getOrderNumber()
217 {
218 return $this->orderNumber;
219 }
220
227 public function getPurchaseOrderNumber()
228 {
229 return $this->purchaseOrderNumber;
230 }
231
238 public function getCustomerId()
239 {
240 return $this->customerId;
241 }
242
249 public function getCustomerEmail()
250 {
251 return $this->customerEmail;
252 }
253
260 public function getCustomerGroup()
261 {
262 return $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup;
263 }
264
272 public function getBusinessUnit()
273 {
274 return $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit;
275 }
276
286 public function getStore()
287 {
288 return $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store;
289 }
290
298 public function getLineItems()
299 {
300 return $this->lineItems;
301 }
302
310 public function getCustomLineItems()
311 {
312 return $this->customLineItems;
313 }
314
321 public function getTotalPrice()
322 {
323 return $this->totalPrice instanceof MoneyBuilder ? $this->totalPrice->build() : $this->totalPrice;
324 }
325
332 public function getTaxedPrice()
333 {
334 return $this->taxedPrice instanceof TaxedPriceDraftBuilder ? $this->taxedPrice->build() : $this->taxedPrice;
335 }
336
343 public function getPriceRoundingMode()
344 {
345 return $this->priceRoundingMode;
346 }
347
354 public function getTaxRoundingMode()
355 {
356 return $this->taxRoundingMode;
357 }
358
365 public function getTaxCalculationMode()
366 {
367 return $this->taxCalculationMode;
368 }
369
376 public function getInventoryMode()
377 {
378 return $this->inventoryMode;
379 }
380
387 public function getBillingAddress()
388 {
389 return $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress;
390 }
391
398 public function getShippingAddress()
399 {
400 return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress;
401 }
402
409 public function getItemShippingAddresses()
410 {
411 return $this->itemShippingAddresses;
412 }
413
420 public function getShippingInfo()
421 {
422 return $this->shippingInfo instanceof ShippingInfoImportDraftBuilder ? $this->shippingInfo->build() : $this->shippingInfo;
423 }
424
431 public function getPaymentInfo()
432 {
433 return $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo;
434 }
435
442 public function getPaymentState()
443 {
444 return $this->paymentState;
445 }
446
453 public function getShipmentState()
454 {
455 return $this->shipmentState;
456 }
457
464 public function getOrderState()
465 {
466 return $this->orderState;
467 }
468
475 public function getState()
476 {
477 return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
478 }
479
486 public function getCountry()
487 {
488 return $this->country;
489 }
490
497 public function getOrigin()
498 {
499 return $this->origin;
500 }
501
508 public function getCompletedAt()
509 {
510 return $this->completedAt;
511 }
512
519 public function getCustom()
520 {
521 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
522 }
523
528 public function withOrderNumber(?string $orderNumber)
529 {
530 $this->orderNumber = $orderNumber;
531
532 return $this;
533 }
534
539 public function withPurchaseOrderNumber(?string $purchaseOrderNumber)
540 {
541 $this->purchaseOrderNumber = $purchaseOrderNumber;
542
543 return $this;
544 }
545
550 public function withCustomerId(?string $customerId)
551 {
552 $this->customerId = $customerId;
553
554 return $this;
555 }
556
561 public function withCustomerEmail(?string $customerEmail)
562 {
563 $this->customerEmail = $customerEmail;
564
565 return $this;
566 }
567
572 public function withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup)
573 {
574 $this->customerGroup = $customerGroup;
575
576 return $this;
577 }
578
583 public function withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit)
584 {
585 $this->businessUnit = $businessUnit;
586
587 return $this;
588 }
589
594 public function withStore(?StoreResourceIdentifier $store)
595 {
596 $this->store = $store;
597
598 return $this;
599 }
600
605 public function withLineItems(?LineItemImportDraftCollection $lineItems)
606 {
607 $this->lineItems = $lineItems;
608
609 return $this;
610 }
611
617 {
618 $this->customLineItems = $customLineItems;
619
620 return $this;
621 }
622
627 public function withTotalPrice(?Money $totalPrice)
628 {
629 $this->totalPrice = $totalPrice;
630
631 return $this;
632 }
633
638 public function withTaxedPrice(?TaxedPriceDraft $taxedPrice)
639 {
640 $this->taxedPrice = $taxedPrice;
641
642 return $this;
643 }
644
649 public function withPriceRoundingMode(?string $priceRoundingMode)
650 {
651 $this->priceRoundingMode = $priceRoundingMode;
652
653 return $this;
654 }
655
660 public function withTaxRoundingMode(?string $taxRoundingMode)
661 {
662 $this->taxRoundingMode = $taxRoundingMode;
663
664 return $this;
665 }
666
671 public function withTaxCalculationMode(?string $taxCalculationMode)
672 {
673 $this->taxCalculationMode = $taxCalculationMode;
674
675 return $this;
676 }
677
682 public function withInventoryMode(?string $inventoryMode)
683 {
684 $this->inventoryMode = $inventoryMode;
685
686 return $this;
687 }
688
693 public function withBillingAddress(?BaseAddress $billingAddress)
694 {
695 $this->billingAddress = $billingAddress;
696
697 return $this;
698 }
699
704 public function withShippingAddress(?BaseAddress $shippingAddress)
705 {
706 $this->shippingAddress = $shippingAddress;
707
708 return $this;
709 }
710
715 public function withItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses)
716 {
717 $this->itemShippingAddresses = $itemShippingAddresses;
718
719 return $this;
720 }
721
726 public function withShippingInfo(?ShippingInfoImportDraft $shippingInfo)
727 {
728 $this->shippingInfo = $shippingInfo;
729
730 return $this;
731 }
732
737 public function withPaymentInfo(?PaymentInfo $paymentInfo)
738 {
739 $this->paymentInfo = $paymentInfo;
740
741 return $this;
742 }
743
748 public function withPaymentState(?string $paymentState)
749 {
750 $this->paymentState = $paymentState;
751
752 return $this;
753 }
754
759 public function withShipmentState(?string $shipmentState)
760 {
761 $this->shipmentState = $shipmentState;
762
763 return $this;
764 }
765
770 public function withOrderState(?string $orderState)
771 {
772 $this->orderState = $orderState;
773
774 return $this;
775 }
776
781 public function withState(?StateReference $state)
782 {
783 $this->state = $state;
784
785 return $this;
786 }
787
792 public function withCountry(?string $country)
793 {
794 $this->country = $country;
795
796 return $this;
797 }
798
803 public function withOrigin(?string $origin)
804 {
805 $this->origin = $origin;
806
807 return $this;
808 }
809
814 public function withCompletedAt(?DateTimeImmutable $completedAt)
815 {
816 $this->completedAt = $completedAt;
817
818 return $this;
819 }
820
825 public function withCustom(?CustomFieldsDraft $custom)
826 {
827 $this->custom = $custom;
828
829 return $this;
830 }
831
837 {
838 $this->customerGroup = $customerGroup;
839
840 return $this;
841 }
842
848 {
849 $this->businessUnit = $businessUnit;
850
851 return $this;
852 }
853
859 {
860 $this->store = $store;
861
862 return $this;
863 }
864
869 public function withTotalPriceBuilder(?MoneyBuilder $totalPrice)
870 {
871 $this->totalPrice = $totalPrice;
872
873 return $this;
874 }
875
880 public function withTaxedPriceBuilder(?TaxedPriceDraftBuilder $taxedPrice)
881 {
882 $this->taxedPrice = $taxedPrice;
883
884 return $this;
885 }
886
891 public function withBillingAddressBuilder(?BaseAddressBuilder $billingAddress)
892 {
893 $this->billingAddress = $billingAddress;
894
895 return $this;
896 }
897
902 public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress)
903 {
904 $this->shippingAddress = $shippingAddress;
905
906 return $this;
907 }
908
914 {
915 $this->shippingInfo = $shippingInfo;
916
917 return $this;
918 }
919
924 public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo)
925 {
926 $this->paymentInfo = $paymentInfo;
927
928 return $this;
929 }
930
936 {
937 $this->state = $state;
938
939 return $this;
940 }
941
947 {
948 $this->custom = $custom;
949
950 return $this;
951 }
952
953 public function build(): OrderImportDraft
954 {
955 return new OrderImportDraftModel(
956 $this->orderNumber,
957 $this->purchaseOrderNumber,
958 $this->customerId,
959 $this->customerEmail,
960 $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup,
961 $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit,
962 $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store,
963 $this->lineItems,
964 $this->customLineItems,
965 $this->totalPrice instanceof MoneyBuilder ? $this->totalPrice->build() : $this->totalPrice,
966 $this->taxedPrice instanceof TaxedPriceDraftBuilder ? $this->taxedPrice->build() : $this->taxedPrice,
967 $this->priceRoundingMode,
968 $this->taxRoundingMode,
969 $this->taxCalculationMode,
970 $this->inventoryMode,
971 $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress,
972 $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress,
973 $this->itemShippingAddresses,
974 $this->shippingInfo instanceof ShippingInfoImportDraftBuilder ? $this->shippingInfo->build() : $this->shippingInfo,
975 $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo,
976 $this->paymentState,
977 $this->shipmentState,
978 $this->orderState,
979 $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state,
980 $this->country,
981 $this->origin,
982 $this->completedAt,
983 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
984 );
985 }
986
987 public static function of(): OrderImportDraftBuilder
988 {
989 return new self();
990 }
991}
withBusinessUnitBuilder(?BusinessUnitResourceIdentifierBuilder $businessUnit)
withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress)
withLineItems(?LineItemImportDraftCollection $lineItems)
withItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses)
withCustomLineItems(?CustomLineItemImportDraftCollection $customLineItems)
withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup)
withCustomerGroupBuilder(?CustomerGroupResourceIdentifierBuilder $customerGroup)
withShippingInfoBuilder(?ShippingInfoImportDraftBuilder $shippingInfo)
withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit)