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 $taxRoundingMode;
112
117 private $taxCalculationMode;
118
123 private $inventoryMode;
124
129 private $billingAddress;
130
135 private $shippingAddress;
136
141 private $itemShippingAddresses;
142
147 private $shippingInfo;
148
153 private $paymentInfo;
154
159 private $paymentState;
160
165 private $shipmentState;
166
171 private $orderState;
172
177 private $state;
178
183 private $country;
184
189 private $origin;
190
195 private $completedAt;
196
201 private $custom;
202
210 public function getOrderNumber()
211 {
212 return $this->orderNumber;
213 }
214
221 public function getPurchaseOrderNumber()
222 {
223 return $this->purchaseOrderNumber;
224 }
225
232 public function getCustomerId()
233 {
234 return $this->customerId;
235 }
236
243 public function getCustomerEmail()
244 {
245 return $this->customerEmail;
246 }
247
254 public function getCustomerGroup()
255 {
256 return $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup;
257 }
258
266 public function getBusinessUnit()
267 {
268 return $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit;
269 }
270
280 public function getStore()
281 {
282 return $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store;
283 }
284
292 public function getLineItems()
293 {
294 return $this->lineItems;
295 }
296
304 public function getCustomLineItems()
305 {
306 return $this->customLineItems;
307 }
308
315 public function getTotalPrice()
316 {
317 return $this->totalPrice instanceof MoneyBuilder ? $this->totalPrice->build() : $this->totalPrice;
318 }
319
326 public function getTaxedPrice()
327 {
328 return $this->taxedPrice instanceof TaxedPriceDraftBuilder ? $this->taxedPrice->build() : $this->taxedPrice;
329 }
330
337 public function getTaxRoundingMode()
338 {
339 return $this->taxRoundingMode;
340 }
341
348 public function getTaxCalculationMode()
349 {
350 return $this->taxCalculationMode;
351 }
352
359 public function getInventoryMode()
360 {
361 return $this->inventoryMode;
362 }
363
370 public function getBillingAddress()
371 {
372 return $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress;
373 }
374
381 public function getShippingAddress()
382 {
383 return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress;
384 }
385
392 public function getItemShippingAddresses()
393 {
394 return $this->itemShippingAddresses;
395 }
396
403 public function getShippingInfo()
404 {
405 return $this->shippingInfo instanceof ShippingInfoImportDraftBuilder ? $this->shippingInfo->build() : $this->shippingInfo;
406 }
407
414 public function getPaymentInfo()
415 {
416 return $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo;
417 }
418
425 public function getPaymentState()
426 {
427 return $this->paymentState;
428 }
429
436 public function getShipmentState()
437 {
438 return $this->shipmentState;
439 }
440
447 public function getOrderState()
448 {
449 return $this->orderState;
450 }
451
458 public function getState()
459 {
460 return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
461 }
462
469 public function getCountry()
470 {
471 return $this->country;
472 }
473
480 public function getOrigin()
481 {
482 return $this->origin;
483 }
484
491 public function getCompletedAt()
492 {
493 return $this->completedAt;
494 }
495
502 public function getCustom()
503 {
504 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
505 }
506
511 public function withOrderNumber(?string $orderNumber)
512 {
513 $this->orderNumber = $orderNumber;
514
515 return $this;
516 }
517
522 public function withPurchaseOrderNumber(?string $purchaseOrderNumber)
523 {
524 $this->purchaseOrderNumber = $purchaseOrderNumber;
525
526 return $this;
527 }
528
533 public function withCustomerId(?string $customerId)
534 {
535 $this->customerId = $customerId;
536
537 return $this;
538 }
539
544 public function withCustomerEmail(?string $customerEmail)
545 {
546 $this->customerEmail = $customerEmail;
547
548 return $this;
549 }
550
555 public function withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup)
556 {
557 $this->customerGroup = $customerGroup;
558
559 return $this;
560 }
561
566 public function withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit)
567 {
568 $this->businessUnit = $businessUnit;
569
570 return $this;
571 }
572
577 public function withStore(?StoreResourceIdentifier $store)
578 {
579 $this->store = $store;
580
581 return $this;
582 }
583
588 public function withLineItems(?LineItemImportDraftCollection $lineItems)
589 {
590 $this->lineItems = $lineItems;
591
592 return $this;
593 }
594
600 {
601 $this->customLineItems = $customLineItems;
602
603 return $this;
604 }
605
610 public function withTotalPrice(?Money $totalPrice)
611 {
612 $this->totalPrice = $totalPrice;
613
614 return $this;
615 }
616
621 public function withTaxedPrice(?TaxedPriceDraft $taxedPrice)
622 {
623 $this->taxedPrice = $taxedPrice;
624
625 return $this;
626 }
627
632 public function withTaxRoundingMode(?string $taxRoundingMode)
633 {
634 $this->taxRoundingMode = $taxRoundingMode;
635
636 return $this;
637 }
638
643 public function withTaxCalculationMode(?string $taxCalculationMode)
644 {
645 $this->taxCalculationMode = $taxCalculationMode;
646
647 return $this;
648 }
649
654 public function withInventoryMode(?string $inventoryMode)
655 {
656 $this->inventoryMode = $inventoryMode;
657
658 return $this;
659 }
660
665 public function withBillingAddress(?BaseAddress $billingAddress)
666 {
667 $this->billingAddress = $billingAddress;
668
669 return $this;
670 }
671
676 public function withShippingAddress(?BaseAddress $shippingAddress)
677 {
678 $this->shippingAddress = $shippingAddress;
679
680 return $this;
681 }
682
687 public function withItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses)
688 {
689 $this->itemShippingAddresses = $itemShippingAddresses;
690
691 return $this;
692 }
693
698 public function withShippingInfo(?ShippingInfoImportDraft $shippingInfo)
699 {
700 $this->shippingInfo = $shippingInfo;
701
702 return $this;
703 }
704
709 public function withPaymentInfo(?PaymentInfo $paymentInfo)
710 {
711 $this->paymentInfo = $paymentInfo;
712
713 return $this;
714 }
715
720 public function withPaymentState(?string $paymentState)
721 {
722 $this->paymentState = $paymentState;
723
724 return $this;
725 }
726
731 public function withShipmentState(?string $shipmentState)
732 {
733 $this->shipmentState = $shipmentState;
734
735 return $this;
736 }
737
742 public function withOrderState(?string $orderState)
743 {
744 $this->orderState = $orderState;
745
746 return $this;
747 }
748
753 public function withState(?StateReference $state)
754 {
755 $this->state = $state;
756
757 return $this;
758 }
759
764 public function withCountry(?string $country)
765 {
766 $this->country = $country;
767
768 return $this;
769 }
770
775 public function withOrigin(?string $origin)
776 {
777 $this->origin = $origin;
778
779 return $this;
780 }
781
786 public function withCompletedAt(?DateTimeImmutable $completedAt)
787 {
788 $this->completedAt = $completedAt;
789
790 return $this;
791 }
792
797 public function withCustom(?CustomFieldsDraft $custom)
798 {
799 $this->custom = $custom;
800
801 return $this;
802 }
803
809 {
810 $this->customerGroup = $customerGroup;
811
812 return $this;
813 }
814
820 {
821 $this->businessUnit = $businessUnit;
822
823 return $this;
824 }
825
831 {
832 $this->store = $store;
833
834 return $this;
835 }
836
841 public function withTotalPriceBuilder(?MoneyBuilder $totalPrice)
842 {
843 $this->totalPrice = $totalPrice;
844
845 return $this;
846 }
847
852 public function withTaxedPriceBuilder(?TaxedPriceDraftBuilder $taxedPrice)
853 {
854 $this->taxedPrice = $taxedPrice;
855
856 return $this;
857 }
858
863 public function withBillingAddressBuilder(?BaseAddressBuilder $billingAddress)
864 {
865 $this->billingAddress = $billingAddress;
866
867 return $this;
868 }
869
874 public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress)
875 {
876 $this->shippingAddress = $shippingAddress;
877
878 return $this;
879 }
880
886 {
887 $this->shippingInfo = $shippingInfo;
888
889 return $this;
890 }
891
896 public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo)
897 {
898 $this->paymentInfo = $paymentInfo;
899
900 return $this;
901 }
902
908 {
909 $this->state = $state;
910
911 return $this;
912 }
913
919 {
920 $this->custom = $custom;
921
922 return $this;
923 }
924
925 public function build(): OrderImportDraft
926 {
927 return new OrderImportDraftModel(
928 $this->orderNumber,
929 $this->purchaseOrderNumber,
930 $this->customerId,
931 $this->customerEmail,
932 $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup,
933 $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit,
934 $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store,
935 $this->lineItems,
936 $this->customLineItems,
937 $this->totalPrice instanceof MoneyBuilder ? $this->totalPrice->build() : $this->totalPrice,
938 $this->taxedPrice instanceof TaxedPriceDraftBuilder ? $this->taxedPrice->build() : $this->taxedPrice,
939 $this->taxRoundingMode,
940 $this->taxCalculationMode,
941 $this->inventoryMode,
942 $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress,
943 $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress,
944 $this->itemShippingAddresses,
945 $this->shippingInfo instanceof ShippingInfoImportDraftBuilder ? $this->shippingInfo->build() : $this->shippingInfo,
946 $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo,
947 $this->paymentState,
948 $this->shipmentState,
949 $this->orderState,
950 $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state,
951 $this->country,
952 $this->origin,
953 $this->completedAt,
954 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
955 );
956 }
957
958 public static function of(): OrderImportDraftBuilder
959 {
960 return new self();
961 }
962}
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)