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
198 public function getCustomer()
199 {
200 return $this->customer instanceof CustomerKeyReferenceBuilder ? $this->customer->build() : $this->customer;
201 }
202
209 public function getCustomerEmail()
210 {
211 return $this->customerEmail;
212 }
213
220 public function getLineItems()
221 {
222 return $this->lineItems;
223 }
224
231 public function getCustomLineItems()
232 {
233 return $this->customLineItems;
234 }
235
242 public function getTotalPrice()
243 {
244 return $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice;
245 }
246
253 public function getTaxedPrice()
254 {
255 return $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice;
256 }
257
264 public function getShippingAddress()
265 {
266 return $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress;
267 }
268
275 public function getBillingAddress()
276 {
277 return $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress;
278 }
279
286 public function getCustomerGroup()
287 {
288 return $this->customerGroup instanceof CustomerGroupKeyReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup;
289 }
290
297 public function getCountry()
298 {
299 return $this->country;
300 }
301
308 public function getOrderState()
309 {
310 return $this->orderState;
311 }
312
319 public function getShipmentState()
320 {
321 return $this->shipmentState;
322 }
323
330 public function getPaymentState()
331 {
332 return $this->paymentState;
333 }
334
341 public function getShippingInfo()
342 {
343 return $this->shippingInfo instanceof ShippingInfoImportDraftBuilder ? $this->shippingInfo->build() : $this->shippingInfo;
344 }
345
352 public function getCompletedAt()
353 {
354 return $this->completedAt;
355 }
356
363 public function getCustom()
364 {
365 return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom;
366 }
367
374 public function getInventoryMode()
375 {
376 return $this->inventoryMode;
377 }
378
385 public function getTaxRoundingMode()
386 {
387 return $this->taxRoundingMode;
388 }
389
396 public function getTaxCalculationMode()
397 {
398 return $this->taxCalculationMode;
399 }
400
407 public function getOrigin()
408 {
409 return $this->origin;
410 }
411
418 public function getItemShippingAddresses()
419 {
420 return $this->itemShippingAddresses;
421 }
422
429 public function getStore()
430 {
431 return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store;
432 }
433
440 public function getState()
441 {
442 return $this->state instanceof StateKeyReferenceBuilder ? $this->state->build() : $this->state;
443 }
444
449 public function withOrderNumber(?string $orderNumber)
450 {
451 $this->orderNumber = $orderNumber;
452
453 return $this;
454 }
455
460 public function withCustomer(?CustomerKeyReference $customer)
461 {
462 $this->customer = $customer;
463
464 return $this;
465 }
466
471 public function withCustomerEmail(?string $customerEmail)
472 {
473 $this->customerEmail = $customerEmail;
474
475 return $this;
476 }
477
482 public function withLineItems(?LineItemImportDraftCollection $lineItems)
483 {
484 $this->lineItems = $lineItems;
485
486 return $this;
487 }
488
493 public function withCustomLineItems(?CustomLineItemDraftCollection $customLineItems)
494 {
495 $this->customLineItems = $customLineItems;
496
497 return $this;
498 }
499
504 public function withTotalPrice(?TypedMoney $totalPrice)
505 {
506 $this->totalPrice = $totalPrice;
507
508 return $this;
509 }
510
515 public function withTaxedPrice(?TaxedPrice $taxedPrice)
516 {
517 $this->taxedPrice = $taxedPrice;
518
519 return $this;
520 }
521
526 public function withShippingAddress(?Address $shippingAddress)
527 {
528 $this->shippingAddress = $shippingAddress;
529
530 return $this;
531 }
532
537 public function withBillingAddress(?Address $billingAddress)
538 {
539 $this->billingAddress = $billingAddress;
540
541 return $this;
542 }
543
548 public function withCustomerGroup(?CustomerGroupKeyReference $customerGroup)
549 {
550 $this->customerGroup = $customerGroup;
551
552 return $this;
553 }
554
559 public function withCountry(?string $country)
560 {
561 $this->country = $country;
562
563 return $this;
564 }
565
570 public function withOrderState(?string $orderState)
571 {
572 $this->orderState = $orderState;
573
574 return $this;
575 }
576
581 public function withShipmentState(?string $shipmentState)
582 {
583 $this->shipmentState = $shipmentState;
584
585 return $this;
586 }
587
592 public function withPaymentState(?string $paymentState)
593 {
594 $this->paymentState = $paymentState;
595
596 return $this;
597 }
598
603 public function withShippingInfo(?ShippingInfoImportDraft $shippingInfo)
604 {
605 $this->shippingInfo = $shippingInfo;
606
607 return $this;
608 }
609
614 public function withCompletedAt(?DateTimeImmutable $completedAt)
615 {
616 $this->completedAt = $completedAt;
617
618 return $this;
619 }
620
625 public function withCustom(?Custom $custom)
626 {
627 $this->custom = $custom;
628
629 return $this;
630 }
631
636 public function withInventoryMode(?string $inventoryMode)
637 {
638 $this->inventoryMode = $inventoryMode;
639
640 return $this;
641 }
642
647 public function withTaxRoundingMode(?string $taxRoundingMode)
648 {
649 $this->taxRoundingMode = $taxRoundingMode;
650
651 return $this;
652 }
653
658 public function withTaxCalculationMode(?string $taxCalculationMode)
659 {
660 $this->taxCalculationMode = $taxCalculationMode;
661
662 return $this;
663 }
664
669 public function withOrigin(?string $origin)
670 {
671 $this->origin = $origin;
672
673 return $this;
674 }
675
680 public function withItemShippingAddresses(?AddressCollection $itemShippingAddresses)
681 {
682 $this->itemShippingAddresses = $itemShippingAddresses;
683
684 return $this;
685 }
686
691 public function withStore(?StoreKeyReference $store)
692 {
693 $this->store = $store;
694
695 return $this;
696 }
697
702 public function withState(?StateKeyReference $state)
703 {
704 $this->state = $state;
705
706 return $this;
707 }
708
714 {
715 $this->customer = $customer;
716
717 return $this;
718 }
719
724 public function withTotalPriceBuilder(?TypedMoneyBuilder $totalPrice)
725 {
726 $this->totalPrice = $totalPrice;
727
728 return $this;
729 }
730
735 public function withTaxedPriceBuilder(?TaxedPriceBuilder $taxedPrice)
736 {
737 $this->taxedPrice = $taxedPrice;
738
739 return $this;
740 }
741
746 public function withShippingAddressBuilder(?AddressBuilder $shippingAddress)
747 {
748 $this->shippingAddress = $shippingAddress;
749
750 return $this;
751 }
752
757 public function withBillingAddressBuilder(?AddressBuilder $billingAddress)
758 {
759 $this->billingAddress = $billingAddress;
760
761 return $this;
762 }
763
769 {
770 $this->customerGroup = $customerGroup;
771
772 return $this;
773 }
774
780 {
781 $this->shippingInfo = $shippingInfo;
782
783 return $this;
784 }
785
790 public function withCustomBuilder(?CustomBuilder $custom)
791 {
792 $this->custom = $custom;
793
794 return $this;
795 }
796
802 {
803 $this->store = $store;
804
805 return $this;
806 }
807
813 {
814 $this->state = $state;
815
816 return $this;
817 }
818
819 public function build(): OrderImport
820 {
821 return new OrderImportModel(
822 $this->orderNumber,
823 $this->customer instanceof CustomerKeyReferenceBuilder ? $this->customer->build() : $this->customer,
824 $this->customerEmail,
825 $this->lineItems,
826 $this->customLineItems,
827 $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice,
828 $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice,
829 $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress,
830 $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress,
831 $this->customerGroup instanceof CustomerGroupKeyReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
832 $this->country,
833 $this->orderState,
834 $this->shipmentState,
835 $this->paymentState,
836 $this->shippingInfo instanceof ShippingInfoImportDraftBuilder ? $this->shippingInfo->build() : $this->shippingInfo,
837 $this->completedAt,
838 $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom,
839 $this->inventoryMode,
840 $this->taxRoundingMode,
841 $this->taxCalculationMode,
842 $this->origin,
843 $this->itemShippingAddresses,
844 $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store,
845 $this->state instanceof StateKeyReferenceBuilder ? $this->state->build() : $this->state
846 );
847 }
848
849 public static function of(): OrderImportBuilder
850 {
851 return new self();
852 }
853}
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)