commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
OrderImportBuilder.php
1<?php
2
3declare(strict_types=1);
10
31use DateTimeImmutable;
32use stdClass;
33
37final class OrderImportBuilder implements Builder
38{
43 private $orderNumber;
44
49 private $customer;
50
55 private $customerEmail;
56
61 private $lineItems;
62
67 private $customLineItems;
68
73 private $totalPrice;
74
79 private $taxedPrice;
80
85 private $shippingAddress;
86
91 private $billingAddress;
92
97 private $customerGroup;
98
103 private $country;
104
109 private $orderState;
110
115 private $shipmentState;
116
121 private $paymentState;
122
127 private $shippingInfo;
128
133 private $completedAt;
134
139 private $custom;
140
145 private $inventoryMode;
146
151 private $taxRoundingMode;
152
157 private $taxCalculationMode;
158
163 private $origin;
164
169 private $itemShippingAddresses;
170
175 private $store;
176
181 private $state;
182
189 public function getOrderNumber()
190 {
191 return $this->orderNumber;
192 }
193
200 public function getCustomer()
201 {
202 return $this->customer instanceof CustomerKeyReferenceBuilder ? $this->customer->build() : $this->customer;
203 }
204
211 public function getCustomerEmail()
212 {
213 return $this->customerEmail;
214 }
215
222 public function getLineItems()
223 {
224 return $this->lineItems;
225 }
226
233 public function getCustomLineItems()
234 {
235 return $this->customLineItems;
236 }
237
244 public function getTotalPrice()
245 {
246 return $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice;
247 }
248
255 public function getTaxedPrice()
256 {
257 return $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice;
258 }
259
266 public function getShippingAddress()
267 {
268 return $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress;
269 }
270
277 public function getBillingAddress()
278 {
279 return $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress;
280 }
281
288 public function getCustomerGroup()
289 {
290 return $this->customerGroup instanceof CustomerGroupKeyReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup;
291 }
292
299 public function getCountry()
300 {
301 return $this->country;
302 }
303
310 public function getOrderState()
311 {
312 return $this->orderState;
313 }
314
321 public function getShipmentState()
322 {
323 return $this->shipmentState;
324 }
325
332 public function getPaymentState()
333 {
334 return $this->paymentState;
335 }
336
343 public function getShippingInfo()
344 {
345 return $this->shippingInfo instanceof ShippingInfoImportDraftBuilder ? $this->shippingInfo->build() : $this->shippingInfo;
346 }
347
354 public function getCompletedAt()
355 {
356 return $this->completedAt;
357 }
358
365 public function getCustom()
366 {
367 return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom;
368 }
369
376 public function getInventoryMode()
377 {
378 return $this->inventoryMode;
379 }
380
387 public function getTaxRoundingMode()
388 {
389 return $this->taxRoundingMode;
390 }
391
398 public function getTaxCalculationMode()
399 {
400 return $this->taxCalculationMode;
401 }
402
409 public function getOrigin()
410 {
411 return $this->origin;
412 }
413
420 public function getItemShippingAddresses()
421 {
422 return $this->itemShippingAddresses;
423 }
424
431 public function getStore()
432 {
433 return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store;
434 }
435
442 public function getState()
443 {
444 return $this->state instanceof StateKeyReferenceBuilder ? $this->state->build() : $this->state;
445 }
446
451 public function withOrderNumber(?string $orderNumber)
452 {
453 $this->orderNumber = $orderNumber;
454
455 return $this;
456 }
457
462 public function withCustomer(?CustomerKeyReference $customer)
463 {
464 $this->customer = $customer;
465
466 return $this;
467 }
468
473 public function withCustomerEmail(?string $customerEmail)
474 {
475 $this->customerEmail = $customerEmail;
476
477 return $this;
478 }
479
484 public function withLineItems(?LineItemImportDraftCollection $lineItems)
485 {
486 $this->lineItems = $lineItems;
487
488 return $this;
489 }
490
495 public function withCustomLineItems(?CustomLineItemDraftCollection $customLineItems)
496 {
497 $this->customLineItems = $customLineItems;
498
499 return $this;
500 }
501
506 public function withTotalPrice(?TypedMoney $totalPrice)
507 {
508 $this->totalPrice = $totalPrice;
509
510 return $this;
511 }
512
517 public function withTaxedPrice(?TaxedPrice $taxedPrice)
518 {
519 $this->taxedPrice = $taxedPrice;
520
521 return $this;
522 }
523
528 public function withShippingAddress(?Address $shippingAddress)
529 {
530 $this->shippingAddress = $shippingAddress;
531
532 return $this;
533 }
534
539 public function withBillingAddress(?Address $billingAddress)
540 {
541 $this->billingAddress = $billingAddress;
542
543 return $this;
544 }
545
550 public function withCustomerGroup(?CustomerGroupKeyReference $customerGroup)
551 {
552 $this->customerGroup = $customerGroup;
553
554 return $this;
555 }
556
561 public function withCountry(?string $country)
562 {
563 $this->country = $country;
564
565 return $this;
566 }
567
572 public function withOrderState(?string $orderState)
573 {
574 $this->orderState = $orderState;
575
576 return $this;
577 }
578
583 public function withShipmentState(?string $shipmentState)
584 {
585 $this->shipmentState = $shipmentState;
586
587 return $this;
588 }
589
594 public function withPaymentState(?string $paymentState)
595 {
596 $this->paymentState = $paymentState;
597
598 return $this;
599 }
600
605 public function withShippingInfo(?ShippingInfoImportDraft $shippingInfo)
606 {
607 $this->shippingInfo = $shippingInfo;
608
609 return $this;
610 }
611
616 public function withCompletedAt(?DateTimeImmutable $completedAt)
617 {
618 $this->completedAt = $completedAt;
619
620 return $this;
621 }
622
627 public function withCustom(?Custom $custom)
628 {
629 $this->custom = $custom;
630
631 return $this;
632 }
633
638 public function withInventoryMode(?string $inventoryMode)
639 {
640 $this->inventoryMode = $inventoryMode;
641
642 return $this;
643 }
644
649 public function withTaxRoundingMode(?string $taxRoundingMode)
650 {
651 $this->taxRoundingMode = $taxRoundingMode;
652
653 return $this;
654 }
655
660 public function withTaxCalculationMode(?string $taxCalculationMode)
661 {
662 $this->taxCalculationMode = $taxCalculationMode;
663
664 return $this;
665 }
666
671 public function withOrigin(?string $origin)
672 {
673 $this->origin = $origin;
674
675 return $this;
676 }
677
682 public function withItemShippingAddresses(?AddressCollection $itemShippingAddresses)
683 {
684 $this->itemShippingAddresses = $itemShippingAddresses;
685
686 return $this;
687 }
688
693 public function withStore(?StoreKeyReference $store)
694 {
695 $this->store = $store;
696
697 return $this;
698 }
699
704 public function withState(?StateKeyReference $state)
705 {
706 $this->state = $state;
707
708 return $this;
709 }
710
716 {
717 $this->customer = $customer;
718
719 return $this;
720 }
721
726 public function withTotalPriceBuilder(?TypedMoneyBuilder $totalPrice)
727 {
728 $this->totalPrice = $totalPrice;
729
730 return $this;
731 }
732
737 public function withTaxedPriceBuilder(?TaxedPriceBuilder $taxedPrice)
738 {
739 $this->taxedPrice = $taxedPrice;
740
741 return $this;
742 }
743
748 public function withShippingAddressBuilder(?AddressBuilder $shippingAddress)
749 {
750 $this->shippingAddress = $shippingAddress;
751
752 return $this;
753 }
754
759 public function withBillingAddressBuilder(?AddressBuilder $billingAddress)
760 {
761 $this->billingAddress = $billingAddress;
762
763 return $this;
764 }
765
771 {
772 $this->customerGroup = $customerGroup;
773
774 return $this;
775 }
776
782 {
783 $this->shippingInfo = $shippingInfo;
784
785 return $this;
786 }
787
792 public function withCustomBuilder(?CustomBuilder $custom)
793 {
794 $this->custom = $custom;
795
796 return $this;
797 }
798
804 {
805 $this->store = $store;
806
807 return $this;
808 }
809
815 {
816 $this->state = $state;
817
818 return $this;
819 }
820
821 public function build(): OrderImport
822 {
823 return new OrderImportModel(
824 $this->orderNumber,
825 $this->customer instanceof CustomerKeyReferenceBuilder ? $this->customer->build() : $this->customer,
826 $this->customerEmail,
827 $this->lineItems,
828 $this->customLineItems,
829 $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice,
830 $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice,
831 $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress,
832 $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress,
833 $this->customerGroup instanceof CustomerGroupKeyReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
834 $this->country,
835 $this->orderState,
836 $this->shipmentState,
837 $this->paymentState,
838 $this->shippingInfo instanceof ShippingInfoImportDraftBuilder ? $this->shippingInfo->build() : $this->shippingInfo,
839 $this->completedAt,
840 $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom,
841 $this->inventoryMode,
842 $this->taxRoundingMode,
843 $this->taxCalculationMode,
844 $this->origin,
845 $this->itemShippingAddresses,
846 $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store,
847 $this->state instanceof StateKeyReferenceBuilder ? $this->state->build() : $this->state
848 );
849 }
850
851 public static function of(): OrderImportBuilder
852 {
853 return new self();
854 }
855}
withCustomerBuilder(?CustomerKeyReferenceBuilder $customer)
withShippingInfo(?ShippingInfoImportDraft $shippingInfo)
withItemShippingAddresses(?AddressCollection $itemShippingAddresses)
withCustomLineItems(?CustomLineItemDraftCollection $customLineItems)
withCustomerGroup(?CustomerGroupKeyReference $customerGroup)
withShippingInfoBuilder(?ShippingInfoImportDraftBuilder $shippingInfo)
withLineItems(?LineItemImportDraftCollection $lineItems)
withShippingAddressBuilder(?AddressBuilder $shippingAddress)
withCustomerGroupBuilder(?CustomerGroupKeyReferenceBuilder $customerGroup)