commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
OrderModel.php
1<?php
2
3declare(strict_types=1);
10
60use DateTimeImmutable;
61use stdClass;
62
66final class OrderModel extends JsonObjectModel implements Order
67{
72 protected $id;
73
78 protected $version;
79
84 protected $createdAt;
85
90 protected $lastModifiedAt;
91
96 protected $orderNumber;
97
103
108 protected $customerId;
109
114 protected $customerEmail;
115
120 protected $customerGroup;
121
126 protected $anonymousId;
127
132 protected $businessUnit;
133
138 protected $store;
139
144 protected $lineItems;
145
151
156 protected $totalPrice;
157
162 protected $taxedPrice;
163
169
175
181
186 protected $taxMode;
187
193
199
204 protected $inventoryMode;
205
211
217
222 protected $shippingMode;
223
228 protected $shippingKey;
229
234 protected $shippingInfo;
235
241
247
252 protected $shipping;
253
259
264 protected $discountCodes;
265
271
276 protected $refusedGifts;
277
282 protected $paymentInfo;
283
288 protected $country;
289
294 protected $locale;
295
300 protected $origin;
301
306 protected $cart;
307
312 protected $quote;
313
319
324 protected $orderState;
325
330 protected $shipmentState;
331
336 protected $paymentState;
337
342 protected $state;
343
348 protected $syncInfo;
349
354 protected $returnInfo;
355
361
367
372 protected $custom;
373
378 protected $completedAt;
379
385
390 protected $createdBy;
391
392
396 public function __construct(
397 ?string $id = null,
398 ?int $version = null,
399 ?DateTimeImmutable $createdAt = null,
400 ?DateTimeImmutable $lastModifiedAt = null,
401 ?string $orderNumber = null,
402 ?string $purchaseOrderNumber = null,
403 ?string $customerId = null,
404 ?string $customerEmail = null,
406 ?string $anonymousId = null,
412 ?TaxedPrice $taxedPrice = null,
415 ?string $priceRoundingMode = null,
416 ?string $taxMode = null,
417 ?string $taxRoundingMode = null,
418 ?string $taxCalculationMode = null,
419 ?string $inventoryMode = null,
420 ?Address $billingAddress = null,
422 ?string $shippingMode = null,
423 ?string $shippingKey = null,
433 ?string $country = null,
434 ?string $locale = null,
435 ?string $origin = null,
436 ?CartReference $cart = null,
437 ?QuoteReference $quote = null,
439 ?string $orderState = null,
440 ?string $shipmentState = null,
441 ?string $paymentState = null,
442 ?StateReference $state = null,
446 ?int $lastMessageSequenceNumber = null,
447 ?CustomFields $custom = null,
448 ?DateTimeImmutable $completedAt = null,
450 ?CreatedBy $createdBy = null
451 ) {
452 $this->id = $id;
453 $this->version = $version;
454 $this->createdAt = $createdAt;
455 $this->lastModifiedAt = $lastModifiedAt;
456 $this->orderNumber = $orderNumber;
457 $this->purchaseOrderNumber = $purchaseOrderNumber;
458 $this->customerId = $customerId;
459 $this->customerEmail = $customerEmail;
460 $this->customerGroup = $customerGroup;
461 $this->anonymousId = $anonymousId;
462 $this->businessUnit = $businessUnit;
463 $this->store = $store;
464 $this->lineItems = $lineItems;
465 $this->customLineItems = $customLineItems;
466 $this->totalPrice = $totalPrice;
467 $this->taxedPrice = $taxedPrice;
468 $this->taxedShippingPrice = $taxedShippingPrice;
469 $this->discountOnTotalPrice = $discountOnTotalPrice;
470 $this->priceRoundingMode = $priceRoundingMode;
471 $this->taxMode = $taxMode;
472 $this->taxRoundingMode = $taxRoundingMode;
473 $this->taxCalculationMode = $taxCalculationMode;
474 $this->inventoryMode = $inventoryMode;
475 $this->billingAddress = $billingAddress;
476 $this->shippingAddress = $shippingAddress;
477 $this->shippingMode = $shippingMode;
478 $this->shippingKey = $shippingKey;
479 $this->shippingInfo = $shippingInfo;
480 $this->shippingRateInput = $shippingRateInput;
481 $this->shippingCustomFields = $shippingCustomFields;
482 $this->shipping = $shipping;
483 $this->itemShippingAddresses = $itemShippingAddresses;
484 $this->discountCodes = $discountCodes;
485 $this->directDiscounts = $directDiscounts;
486 $this->refusedGifts = $refusedGifts;
487 $this->paymentInfo = $paymentInfo;
488 $this->country = $country;
489 $this->locale = $locale;
490 $this->origin = $origin;
491 $this->cart = $cart;
492 $this->quote = $quote;
493 $this->recurringOrder = $recurringOrder;
494 $this->orderState = $orderState;
495 $this->shipmentState = $shipmentState;
496 $this->paymentState = $paymentState;
497 $this->state = $state;
498 $this->syncInfo = $syncInfo;
499 $this->returnInfo = $returnInfo;
500 $this->discountTypeCombination = $discountTypeCombination;
501 $this->lastMessageSequenceNumber = $lastMessageSequenceNumber;
502 $this->custom = $custom;
503 $this->completedAt = $completedAt;
504 $this->lastModifiedBy = $lastModifiedBy;
505 $this->createdBy = $createdBy;
506 }
507
514 public function getId()
515 {
516 if (is_null($this->id)) {
518 $data = $this->raw(self::FIELD_ID);
519 if (is_null($data)) {
520 return null;
521 }
522 $this->id = (string) $data;
523 }
524
525 return $this->id;
526 }
527
534 public function getVersion()
535 {
536 if (is_null($this->version)) {
538 $data = $this->raw(self::FIELD_VERSION);
539 if (is_null($data)) {
540 return null;
541 }
542 $this->version = (int) $data;
543 }
544
545 return $this->version;
546 }
547
554 public function getCreatedAt()
555 {
556 if (is_null($this->createdAt)) {
558 $data = $this->raw(self::FIELD_CREATED_AT);
559 if (is_null($data)) {
560 return null;
561 }
562 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
563 if (false === $data) {
564 return null;
565 }
566 $this->createdAt = $data;
567 }
568
569 return $this->createdAt;
570 }
571
578 public function getLastModifiedAt()
579 {
580 if (is_null($this->lastModifiedAt)) {
582 $data = $this->raw(self::FIELD_LAST_MODIFIED_AT);
583 if (is_null($data)) {
584 return null;
585 }
586 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
587 if (false === $data) {
588 return null;
589 }
590 $this->lastModifiedAt = $data;
591 }
592
594 }
595
602 public function getOrderNumber()
603 {
604 if (is_null($this->orderNumber)) {
606 $data = $this->raw(self::FIELD_ORDER_NUMBER);
607 if (is_null($data)) {
608 return null;
609 }
610 $this->orderNumber = (string) $data;
611 }
612
613 return $this->orderNumber;
614 }
615
623 public function getPurchaseOrderNumber()
624 {
625 if (is_null($this->purchaseOrderNumber)) {
627 $data = $this->raw(self::FIELD_PURCHASE_ORDER_NUMBER);
628 if (is_null($data)) {
629 return null;
630 }
631 $this->purchaseOrderNumber = (string) $data;
632 }
633
635 }
636
643 public function getCustomerId()
644 {
645 if (is_null($this->customerId)) {
647 $data = $this->raw(self::FIELD_CUSTOMER_ID);
648 if (is_null($data)) {
649 return null;
650 }
651 $this->customerId = (string) $data;
652 }
653
654 return $this->customerId;
655 }
656
663 public function getCustomerEmail()
664 {
665 if (is_null($this->customerEmail)) {
667 $data = $this->raw(self::FIELD_CUSTOMER_EMAIL);
668 if (is_null($data)) {
669 return null;
670 }
671 $this->customerEmail = (string) $data;
672 }
673
675 }
676
684 public function getCustomerGroup()
685 {
686 if (is_null($this->customerGroup)) {
688 $data = $this->raw(self::FIELD_CUSTOMER_GROUP);
689 if (is_null($data)) {
690 return null;
691 }
692
693 $this->customerGroup = CustomerGroupReferenceModel::of($data);
694 }
695
697 }
698
705 public function getAnonymousId()
706 {
707 if (is_null($this->anonymousId)) {
709 $data = $this->raw(self::FIELD_ANONYMOUS_ID);
710 if (is_null($data)) {
711 return null;
712 }
713 $this->anonymousId = (string) $data;
714 }
715
716 return $this->anonymousId;
717 }
718
725 public function getBusinessUnit()
726 {
727 if (is_null($this->businessUnit)) {
729 $data = $this->raw(self::FIELD_BUSINESS_UNIT);
730 if (is_null($data)) {
731 return null;
732 }
733
734 $this->businessUnit = BusinessUnitKeyReferenceModel::of($data);
735 }
736
737 return $this->businessUnit;
738 }
739
746 public function getStore()
747 {
748 if (is_null($this->store)) {
750 $data = $this->raw(self::FIELD_STORE);
751 if (is_null($data)) {
752 return null;
753 }
754
755 $this->store = StoreKeyReferenceModel::of($data);
756 }
757
758 return $this->store;
759 }
760
767 public function getLineItems()
768 {
769 if (is_null($this->lineItems)) {
771 $data = $this->raw(self::FIELD_LINE_ITEMS);
772 if (is_null($data)) {
773 return null;
774 }
775 $this->lineItems = LineItemCollection::fromArray($data);
776 }
777
778 return $this->lineItems;
779 }
780
787 public function getCustomLineItems()
788 {
789 if (is_null($this->customLineItems)) {
791 $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEMS);
792 if (is_null($data)) {
793 return null;
794 }
795 $this->customLineItems = CustomLineItemCollection::fromArray($data);
796 }
797
799 }
800
809 public function getTotalPrice()
810 {
811 if (is_null($this->totalPrice)) {
813 $data = $this->raw(self::FIELD_TOTAL_PRICE);
814 if (is_null($data)) {
815 return null;
816 }
817
818 $this->totalPrice = CentPrecisionMoneyModel::of($data);
819 }
820
821 return $this->totalPrice;
822 }
823
834 public function getTaxedPrice()
835 {
836 if (is_null($this->taxedPrice)) {
838 $data = $this->raw(self::FIELD_TAXED_PRICE);
839 if (is_null($data)) {
840 return null;
841 }
842
843 $this->taxedPrice = TaxedPriceModel::of($data);
844 }
845
846 return $this->taxedPrice;
847 }
848
856 public function getTaxedShippingPrice()
857 {
858 if (is_null($this->taxedShippingPrice)) {
860 $data = $this->raw(self::FIELD_TAXED_SHIPPING_PRICE);
861 if (is_null($data)) {
862 return null;
863 }
864
865 $this->taxedShippingPrice = TaxedPriceModel::of($data);
866 }
867
869 }
870
877 public function getDiscountOnTotalPrice()
878 {
879 if (is_null($this->discountOnTotalPrice)) {
881 $data = $this->raw(self::FIELD_DISCOUNT_ON_TOTAL_PRICE);
882 if (is_null($data)) {
883 return null;
884 }
885
886 $this->discountOnTotalPrice = DiscountOnTotalPriceModel::of($data);
887 }
888
890 }
891
898 public function getPriceRoundingMode()
899 {
900 if (is_null($this->priceRoundingMode)) {
902 $data = $this->raw(self::FIELD_PRICE_ROUNDING_MODE);
903 if (is_null($data)) {
904 return null;
905 }
906 $this->priceRoundingMode = (string) $data;
907 }
908
910 }
911
918 public function getTaxMode()
919 {
920 if (is_null($this->taxMode)) {
922 $data = $this->raw(self::FIELD_TAX_MODE);
923 if (is_null($data)) {
924 return null;
925 }
926 $this->taxMode = (string) $data;
927 }
928
929 return $this->taxMode;
930 }
931
938 public function getTaxRoundingMode()
939 {
940 if (is_null($this->taxRoundingMode)) {
942 $data = $this->raw(self::FIELD_TAX_ROUNDING_MODE);
943 if (is_null($data)) {
944 return null;
945 }
946 $this->taxRoundingMode = (string) $data;
947 }
948
950 }
951
958 public function getTaxCalculationMode()
959 {
960 if (is_null($this->taxCalculationMode)) {
962 $data = $this->raw(self::FIELD_TAX_CALCULATION_MODE);
963 if (is_null($data)) {
964 return null;
965 }
966 $this->taxCalculationMode = (string) $data;
967 }
968
970 }
971
978 public function getInventoryMode()
979 {
980 if (is_null($this->inventoryMode)) {
982 $data = $this->raw(self::FIELD_INVENTORY_MODE);
983 if (is_null($data)) {
984 return null;
985 }
986 $this->inventoryMode = (string) $data;
987 }
988
990 }
991
998 public function getBillingAddress()
999 {
1000 if (is_null($this->billingAddress)) {
1002 $data = $this->raw(self::FIELD_BILLING_ADDRESS);
1003 if (is_null($data)) {
1004 return null;
1005 }
1006
1007 $this->billingAddress = AddressModel::of($data);
1008 }
1009
1010 return $this->billingAddress;
1011 }
1012
1020 public function getShippingAddress()
1021 {
1022 if (is_null($this->shippingAddress)) {
1024 $data = $this->raw(self::FIELD_SHIPPING_ADDRESS);
1025 if (is_null($data)) {
1026 return null;
1027 }
1028
1029 $this->shippingAddress = AddressModel::of($data);
1030 }
1031
1033 }
1034
1041 public function getShippingMode()
1042 {
1043 if (is_null($this->shippingMode)) {
1045 $data = $this->raw(self::FIELD_SHIPPING_MODE);
1046 if (is_null($data)) {
1047 return null;
1048 }
1049 $this->shippingMode = (string) $data;
1050 }
1051
1052 return $this->shippingMode;
1053 }
1054
1061 public function getShippingKey()
1062 {
1063 if (is_null($this->shippingKey)) {
1065 $data = $this->raw(self::FIELD_SHIPPING_KEY);
1066 if (is_null($data)) {
1067 return null;
1068 }
1069 $this->shippingKey = (string) $data;
1070 }
1071
1072 return $this->shippingKey;
1073 }
1074
1082 public function getShippingInfo()
1083 {
1084 if (is_null($this->shippingInfo)) {
1086 $data = $this->raw(self::FIELD_SHIPPING_INFO);
1087 if (is_null($data)) {
1088 return null;
1089 }
1090
1091 $this->shippingInfo = ShippingInfoModel::of($data);
1092 }
1093
1094 return $this->shippingInfo;
1095 }
1096
1109 public function getShippingRateInput()
1110 {
1111 if (is_null($this->shippingRateInput)) {
1113 $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT);
1114 if (is_null($data)) {
1115 return null;
1116 }
1117 $className = ShippingRateInputModel::resolveDiscriminatorClass($data);
1118 $this->shippingRateInput = $className::of($data);
1119 }
1120
1122 }
1123
1130 public function getShippingCustomFields()
1131 {
1132 if (is_null($this->shippingCustomFields)) {
1134 $data = $this->raw(self::FIELD_SHIPPING_CUSTOM_FIELDS);
1135 if (is_null($data)) {
1136 return null;
1137 }
1138
1139 $this->shippingCustomFields = CustomFieldsModel::of($data);
1140 }
1141
1143 }
1144
1152 public function getShipping()
1153 {
1154 if (is_null($this->shipping)) {
1156 $data = $this->raw(self::FIELD_SHIPPING);
1157 if (is_null($data)) {
1158 return null;
1159 }
1160 $this->shipping = ShippingCollection::fromArray($data);
1161 }
1162
1163 return $this->shipping;
1164 }
1165
1174 {
1175 if (is_null($this->itemShippingAddresses)) {
1177 $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES);
1178 if (is_null($data)) {
1179 return null;
1180 }
1181 $this->itemShippingAddresses = AddressCollection::fromArray($data);
1182 }
1183
1185 }
1186
1194 public function getDiscountCodes()
1195 {
1196 if (is_null($this->discountCodes)) {
1198 $data = $this->raw(self::FIELD_DISCOUNT_CODES);
1199 if (is_null($data)) {
1200 return null;
1201 }
1202 $this->discountCodes = DiscountCodeInfoCollection::fromArray($data);
1203 }
1204
1205 return $this->discountCodes;
1206 }
1207
1215 public function getDirectDiscounts()
1216 {
1217 if (is_null($this->directDiscounts)) {
1219 $data = $this->raw(self::FIELD_DIRECT_DISCOUNTS);
1220 if (is_null($data)) {
1221 return null;
1222 }
1223 $this->directDiscounts = DirectDiscountCollection::fromArray($data);
1224 }
1225
1227 }
1228
1235 public function getRefusedGifts()
1236 {
1237 if (is_null($this->refusedGifts)) {
1239 $data = $this->raw(self::FIELD_REFUSED_GIFTS);
1240 if (is_null($data)) {
1241 return null;
1242 }
1243 $this->refusedGifts = CartDiscountReferenceCollection::fromArray($data);
1244 }
1245
1246 return $this->refusedGifts;
1247 }
1248
1255 public function getPaymentInfo()
1256 {
1257 if (is_null($this->paymentInfo)) {
1259 $data = $this->raw(self::FIELD_PAYMENT_INFO);
1260 if (is_null($data)) {
1261 return null;
1262 }
1263
1264 $this->paymentInfo = PaymentInfoModel::of($data);
1265 }
1266
1267 return $this->paymentInfo;
1268 }
1269
1276 public function getCountry()
1277 {
1278 if (is_null($this->country)) {
1280 $data = $this->raw(self::FIELD_COUNTRY);
1281 if (is_null($data)) {
1282 return null;
1283 }
1284 $this->country = (string) $data;
1285 }
1286
1287 return $this->country;
1288 }
1289
1297 public function getLocale()
1298 {
1299 if (is_null($this->locale)) {
1301 $data = $this->raw(self::FIELD_LOCALE);
1302 if (is_null($data)) {
1303 return null;
1304 }
1305 $this->locale = (string) $data;
1306 }
1307
1308 return $this->locale;
1309 }
1310
1317 public function getOrigin()
1318 {
1319 if (is_null($this->origin)) {
1321 $data = $this->raw(self::FIELD_ORIGIN);
1322 if (is_null($data)) {
1323 return null;
1324 }
1325 $this->origin = (string) $data;
1326 }
1327
1328 return $this->origin;
1329 }
1330
1338 public function getCart()
1339 {
1340 if (is_null($this->cart)) {
1342 $data = $this->raw(self::FIELD_CART);
1343 if (is_null($data)) {
1344 return null;
1345 }
1346
1347 $this->cart = CartReferenceModel::of($data);
1348 }
1349
1350 return $this->cart;
1351 }
1352
1359 public function getQuote()
1360 {
1361 if (is_null($this->quote)) {
1363 $data = $this->raw(self::FIELD_QUOTE);
1364 if (is_null($data)) {
1365 return null;
1366 }
1367
1368 $this->quote = QuoteReferenceModel::of($data);
1369 }
1370
1371 return $this->quote;
1372 }
1373
1380 public function getRecurringOrder()
1381 {
1382 if (is_null($this->recurringOrder)) {
1384 $data = $this->raw(self::FIELD_RECURRING_ORDER);
1385 if (is_null($data)) {
1386 return null;
1387 }
1388
1389 $this->recurringOrder = RecurringOrderReferenceModel::of($data);
1390 }
1391
1392 return $this->recurringOrder;
1393 }
1394
1401 public function getOrderState()
1402 {
1403 if (is_null($this->orderState)) {
1405 $data = $this->raw(self::FIELD_ORDER_STATE);
1406 if (is_null($data)) {
1407 return null;
1408 }
1409 $this->orderState = (string) $data;
1410 }
1411
1412 return $this->orderState;
1413 }
1414
1421 public function getShipmentState()
1422 {
1423 if (is_null($this->shipmentState)) {
1425 $data = $this->raw(self::FIELD_SHIPMENT_STATE);
1426 if (is_null($data)) {
1427 return null;
1428 }
1429 $this->shipmentState = (string) $data;
1430 }
1431
1432 return $this->shipmentState;
1433 }
1434
1441 public function getPaymentState()
1442 {
1443 if (is_null($this->paymentState)) {
1445 $data = $this->raw(self::FIELD_PAYMENT_STATE);
1446 if (is_null($data)) {
1447 return null;
1448 }
1449 $this->paymentState = (string) $data;
1450 }
1451
1452 return $this->paymentState;
1453 }
1454
1462 public function getState()
1463 {
1464 if (is_null($this->state)) {
1466 $data = $this->raw(self::FIELD_STATE);
1467 if (is_null($data)) {
1468 return null;
1469 }
1470
1471 $this->state = StateReferenceModel::of($data);
1472 }
1473
1474 return $this->state;
1475 }
1476
1484 public function getSyncInfo()
1485 {
1486 if (is_null($this->syncInfo)) {
1488 $data = $this->raw(self::FIELD_SYNC_INFO);
1489 if (is_null($data)) {
1490 return null;
1491 }
1492 $this->syncInfo = SyncInfoCollection::fromArray($data);
1493 }
1494
1495 return $this->syncInfo;
1496 }
1497
1504 public function getReturnInfo()
1505 {
1506 if (is_null($this->returnInfo)) {
1508 $data = $this->raw(self::FIELD_RETURN_INFO);
1509 if (is_null($data)) {
1510 return null;
1511 }
1512 $this->returnInfo = ReturnInfoCollection::fromArray($data);
1513 }
1514
1515 return $this->returnInfo;
1516 }
1517
1525 {
1526 if (is_null($this->discountTypeCombination)) {
1528 $data = $this->raw(self::FIELD_DISCOUNT_TYPE_COMBINATION);
1529 if (is_null($data)) {
1530 return null;
1531 }
1533 $this->discountTypeCombination = $className::of($data);
1534 }
1535
1537 }
1538
1546 {
1547 if (is_null($this->lastMessageSequenceNumber)) {
1549 $data = $this->raw(self::FIELD_LAST_MESSAGE_SEQUENCE_NUMBER);
1550 if (is_null($data)) {
1551 return null;
1552 }
1553 $this->lastMessageSequenceNumber = (int) $data;
1554 }
1555
1557 }
1558
1565 public function getCustom()
1566 {
1567 if (is_null($this->custom)) {
1569 $data = $this->raw(self::FIELD_CUSTOM);
1570 if (is_null($data)) {
1571 return null;
1572 }
1573
1574 $this->custom = CustomFieldsModel::of($data);
1575 }
1576
1577 return $this->custom;
1578 }
1579
1587 public function getCompletedAt()
1588 {
1589 if (is_null($this->completedAt)) {
1591 $data = $this->raw(self::FIELD_COMPLETED_AT);
1592 if (is_null($data)) {
1593 return null;
1594 }
1595 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
1596 if (false === $data) {
1597 return null;
1598 }
1599 $this->completedAt = $data;
1600 }
1601
1602 return $this->completedAt;
1603 }
1604
1611 public function getLastModifiedBy()
1612 {
1613 if (is_null($this->lastModifiedBy)) {
1615 $data = $this->raw(self::FIELD_LAST_MODIFIED_BY);
1616 if (is_null($data)) {
1617 return null;
1618 }
1619
1620 $this->lastModifiedBy = LastModifiedByModel::of($data);
1621 }
1622
1623 return $this->lastModifiedBy;
1624 }
1625
1632 public function getCreatedBy()
1633 {
1634 if (is_null($this->createdBy)) {
1636 $data = $this->raw(self::FIELD_CREATED_BY);
1637 if (is_null($data)) {
1638 return null;
1639 }
1640
1641 $this->createdBy = CreatedByModel::of($data);
1642 }
1643
1644 return $this->createdBy;
1645 }
1646
1647
1651 public function setId(?string $id): void
1652 {
1653 $this->id = $id;
1654 }
1655
1659 public function setVersion(?int $version): void
1660 {
1661 $this->version = $version;
1662 }
1663
1667 public function setCreatedAt(?DateTimeImmutable $createdAt): void
1668 {
1669 $this->createdAt = $createdAt;
1670 }
1671
1675 public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void
1676 {
1677 $this->lastModifiedAt = $lastModifiedAt;
1678 }
1679
1683 public function setOrderNumber(?string $orderNumber): void
1684 {
1685 $this->orderNumber = $orderNumber;
1686 }
1687
1691 public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void
1692 {
1693 $this->purchaseOrderNumber = $purchaseOrderNumber;
1694 }
1695
1699 public function setCustomerId(?string $customerId): void
1700 {
1701 $this->customerId = $customerId;
1702 }
1703
1707 public function setCustomerEmail(?string $customerEmail): void
1708 {
1709 $this->customerEmail = $customerEmail;
1710 }
1711
1716 {
1717 $this->customerGroup = $customerGroup;
1718 }
1719
1723 public function setAnonymousId(?string $anonymousId): void
1724 {
1725 $this->anonymousId = $anonymousId;
1726 }
1727
1732 {
1733 $this->businessUnit = $businessUnit;
1734 }
1735
1739 public function setStore(?StoreKeyReference $store): void
1740 {
1741 $this->store = $store;
1742 }
1743
1748 {
1749 $this->lineItems = $lineItems;
1750 }
1751
1756 {
1757 $this->customLineItems = $customLineItems;
1758 }
1759
1764 {
1765 $this->totalPrice = $totalPrice;
1766 }
1767
1771 public function setTaxedPrice(?TaxedPrice $taxedPrice): void
1772 {
1773 $this->taxedPrice = $taxedPrice;
1774 }
1775
1780 {
1781 $this->taxedShippingPrice = $taxedShippingPrice;
1782 }
1783
1788 {
1789 $this->discountOnTotalPrice = $discountOnTotalPrice;
1790 }
1791
1795 public function setPriceRoundingMode(?string $priceRoundingMode): void
1796 {
1797 $this->priceRoundingMode = $priceRoundingMode;
1798 }
1799
1803 public function setTaxMode(?string $taxMode): void
1804 {
1805 $this->taxMode = $taxMode;
1806 }
1807
1811 public function setTaxRoundingMode(?string $taxRoundingMode): void
1812 {
1813 $this->taxRoundingMode = $taxRoundingMode;
1814 }
1815
1819 public function setTaxCalculationMode(?string $taxCalculationMode): void
1820 {
1821 $this->taxCalculationMode = $taxCalculationMode;
1822 }
1823
1827 public function setInventoryMode(?string $inventoryMode): void
1828 {
1829 $this->inventoryMode = $inventoryMode;
1830 }
1831
1836 {
1837 $this->billingAddress = $billingAddress;
1838 }
1839
1844 {
1845 $this->shippingAddress = $shippingAddress;
1846 }
1847
1851 public function setShippingMode(?string $shippingMode): void
1852 {
1853 $this->shippingMode = $shippingMode;
1854 }
1855
1859 public function setShippingKey(?string $shippingKey): void
1860 {
1861 $this->shippingKey = $shippingKey;
1862 }
1863
1868 {
1869 $this->shippingInfo = $shippingInfo;
1870 }
1871
1876 {
1877 $this->shippingRateInput = $shippingRateInput;
1878 }
1879
1884 {
1885 $this->shippingCustomFields = $shippingCustomFields;
1886 }
1887
1892 {
1893 $this->shipping = $shipping;
1894 }
1895
1900 {
1901 $this->itemShippingAddresses = $itemShippingAddresses;
1902 }
1903
1908 {
1909 $this->discountCodes = $discountCodes;
1910 }
1911
1916 {
1917 $this->directDiscounts = $directDiscounts;
1918 }
1919
1924 {
1925 $this->refusedGifts = $refusedGifts;
1926 }
1927
1932 {
1933 $this->paymentInfo = $paymentInfo;
1934 }
1935
1939 public function setCountry(?string $country): void
1940 {
1941 $this->country = $country;
1942 }
1943
1947 public function setLocale(?string $locale): void
1948 {
1949 $this->locale = $locale;
1950 }
1951
1955 public function setOrigin(?string $origin): void
1956 {
1957 $this->origin = $origin;
1958 }
1959
1963 public function setCart(?CartReference $cart): void
1964 {
1965 $this->cart = $cart;
1966 }
1967
1971 public function setQuote(?QuoteReference $quote): void
1972 {
1973 $this->quote = $quote;
1974 }
1975
1980 {
1981 $this->recurringOrder = $recurringOrder;
1982 }
1983
1987 public function setOrderState(?string $orderState): void
1988 {
1989 $this->orderState = $orderState;
1990 }
1991
1995 public function setShipmentState(?string $shipmentState): void
1996 {
1997 $this->shipmentState = $shipmentState;
1998 }
1999
2003 public function setPaymentState(?string $paymentState): void
2004 {
2005 $this->paymentState = $paymentState;
2006 }
2007
2011 public function setState(?StateReference $state): void
2012 {
2013 $this->state = $state;
2014 }
2015
2020 {
2021 $this->syncInfo = $syncInfo;
2022 }
2023
2028 {
2029 $this->returnInfo = $returnInfo;
2030 }
2031
2036 {
2037 $this->discountTypeCombination = $discountTypeCombination;
2038 }
2039
2044 {
2045 $this->lastMessageSequenceNumber = $lastMessageSequenceNumber;
2046 }
2047
2051 public function setCustom(?CustomFields $custom): void
2052 {
2053 $this->custom = $custom;
2054 }
2055
2059 public function setCompletedAt(?DateTimeImmutable $completedAt): void
2060 {
2061 $this->completedAt = $completedAt;
2062 }
2063
2068 {
2069 $this->lastModifiedBy = $lastModifiedBy;
2070 }
2071
2075 public function setCreatedBy(?CreatedBy $createdBy): void
2076 {
2077 $this->createdBy = $createdBy;
2078 }
2079
2080
2081 #[\ReturnTypeWillChange]
2082 public function jsonSerialize()
2083 {
2084 $data = $this->toArray();
2085 if (isset($data[Order::FIELD_CREATED_AT]) && $data[Order::FIELD_CREATED_AT] instanceof \DateTimeImmutable) {
2086 $data[Order::FIELD_CREATED_AT] = $data[Order::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c');
2087 }
2088
2089 if (isset($data[Order::FIELD_LAST_MODIFIED_AT]) && $data[Order::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) {
2090 $data[Order::FIELD_LAST_MODIFIED_AT] = $data[Order::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c');
2091 }
2092
2093 if (isset($data[Order::FIELD_COMPLETED_AT]) && $data[Order::FIELD_COMPLETED_AT] instanceof \DateTimeImmutable) {
2094 $data[Order::FIELD_COMPLETED_AT] = $data[Order::FIELD_COMPLETED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c');
2095 }
2096 return (object) $data;
2097 }
2098}
setDirectDiscounts(?DirectDiscountCollection $directDiscounts)
setItemShippingAddresses(?AddressCollection $itemShippingAddresses)
setShippingRateInput(?ShippingRateInput $shippingRateInput)
setSyncInfo(?SyncInfoCollection $syncInfo)
setCustomerGroup(?CustomerGroupReference $customerGroup)
setShippingInfo(?ShippingInfo $shippingInfo)
setDiscountTypeCombination(?DiscountTypeCombination $discountTypeCombination)
setShippingAddress(?Address $shippingAddress)
setRecurringOrder(?RecurringOrderReference $recurringOrder)
setTaxRoundingMode(?string $taxRoundingMode)
setTaxCalculationMode(?string $taxCalculationMode)
setDiscountOnTotalPrice(?DiscountOnTotalPrice $discountOnTotalPrice)
__construct(?string $id=null, ?int $version=null, ?DateTimeImmutable $createdAt=null, ?DateTimeImmutable $lastModifiedAt=null, ?string $orderNumber=null, ?string $purchaseOrderNumber=null, ?string $customerId=null, ?string $customerEmail=null, ?CustomerGroupReference $customerGroup=null, ?string $anonymousId=null, ?BusinessUnitKeyReference $businessUnit=null, ?StoreKeyReference $store=null, ?LineItemCollection $lineItems=null, ?CustomLineItemCollection $customLineItems=null, ?CentPrecisionMoney $totalPrice=null, ?TaxedPrice $taxedPrice=null, ?TaxedPrice $taxedShippingPrice=null, ?DiscountOnTotalPrice $discountOnTotalPrice=null, ?string $priceRoundingMode=null, ?string $taxMode=null, ?string $taxRoundingMode=null, ?string $taxCalculationMode=null, ?string $inventoryMode=null, ?Address $billingAddress=null, ?Address $shippingAddress=null, ?string $shippingMode=null, ?string $shippingKey=null, ?ShippingInfo $shippingInfo=null, ?ShippingRateInput $shippingRateInput=null, ?CustomFields $shippingCustomFields=null, ?ShippingCollection $shipping=null, ?AddressCollection $itemShippingAddresses=null, ?DiscountCodeInfoCollection $discountCodes=null, ?DirectDiscountCollection $directDiscounts=null, ?CartDiscountReferenceCollection $refusedGifts=null, ?PaymentInfo $paymentInfo=null, ?string $country=null, ?string $locale=null, ?string $origin=null, ?CartReference $cart=null, ?QuoteReference $quote=null, ?RecurringOrderReference $recurringOrder=null, ?string $orderState=null, ?string $shipmentState=null, ?string $paymentState=null, ?StateReference $state=null, ?SyncInfoCollection $syncInfo=null, ?ReturnInfoCollection $returnInfo=null, ?DiscountTypeCombination $discountTypeCombination=null, ?int $lastMessageSequenceNumber=null, ?CustomFields $custom=null, ?DateTimeImmutable $completedAt=null, ?LastModifiedBy $lastModifiedBy=null, ?CreatedBy $createdBy=null)
setPaymentInfo(?PaymentInfo $paymentInfo)
setCustomLineItems(?CustomLineItemCollection $customLineItems)
setLastModifiedBy(?LastModifiedBy $lastModifiedBy)
setCompletedAt(?DateTimeImmutable $completedAt)
setCreatedAt(?DateTimeImmutable $createdAt)
setRefusedGifts(?CartDiscountReferenceCollection $refusedGifts)
setTaxedShippingPrice(?TaxedPrice $taxedShippingPrice)
setDiscountCodes(?DiscountCodeInfoCollection $discountCodes)
setPurchaseOrderNumber(?string $purchaseOrderNumber)
setTotalPrice(?CentPrecisionMoney $totalPrice)
setBusinessUnit(?BusinessUnitKeyReference $businessUnit)
setShippingCustomFields(?CustomFields $shippingCustomFields)
setReturnInfo(?ReturnInfoCollection $returnInfo)
setPriceRoundingMode(?string $priceRoundingMode)
setBillingAddress(?Address $billingAddress)
setLineItems(?LineItemCollection $lineItems)
setLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
setStore(?StoreKeyReference $store)
setShipping(?ShippingCollection $shipping)
setLastMessageSequenceNumber(?int $lastMessageSequenceNumber)
static fromArray(array $data)