commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
All Classes Namespaces Functions Variables Pages
OrderModel.php
1<?php
2
3declare(strict_types=1);
10
58use DateTimeImmutable;
59use stdClass;
60
64final class OrderModel extends JsonObjectModel implements Order
65{
70 protected $id;
71
76 protected $version;
77
82 protected $createdAt;
83
88 protected $lastModifiedAt;
89
94 protected $orderNumber;
95
101
106 protected $customerId;
107
112 protected $customerEmail;
113
118 protected $customerGroup;
119
124 protected $anonymousId;
125
130 protected $businessUnit;
131
136 protected $store;
137
142 protected $lineItems;
143
149
154 protected $totalPrice;
155
160 protected $taxedPrice;
161
167
173
178 protected $taxMode;
179
185
191
196 protected $inventoryMode;
197
203
209
214 protected $shippingMode;
215
220 protected $shippingKey;
221
226 protected $shippingInfo;
227
233
239
244 protected $shipping;
245
251
256 protected $discountCodes;
257
263
268 protected $refusedGifts;
269
274 protected $paymentInfo;
275
280 protected $country;
281
286 protected $locale;
287
292 protected $origin;
293
298 protected $cart;
299
304 protected $quote;
305
310 protected $orderState;
311
316 protected $shipmentState;
317
322 protected $paymentState;
323
328 protected $state;
329
334 protected $syncInfo;
335
340 protected $returnInfo;
341
347
353
358 protected $custom;
359
364 protected $completedAt;
365
371
376 protected $createdBy;
377
378
382 public function __construct(
383 ?string $id = null,
384 ?int $version = null,
385 ?DateTimeImmutable $createdAt = null,
386 ?DateTimeImmutable $lastModifiedAt = null,
387 ?string $orderNumber = null,
388 ?string $purchaseOrderNumber = null,
389 ?string $customerId = null,
390 ?string $customerEmail = null,
392 ?string $anonymousId = null,
398 ?TaxedPrice $taxedPrice = null,
401 ?string $taxMode = null,
402 ?string $taxRoundingMode = null,
403 ?string $taxCalculationMode = null,
404 ?string $inventoryMode = null,
405 ?Address $billingAddress = null,
407 ?string $shippingMode = null,
408 ?string $shippingKey = null,
418 ?string $country = null,
419 ?string $locale = null,
420 ?string $origin = null,
421 ?CartReference $cart = null,
422 ?QuoteReference $quote = null,
423 ?string $orderState = null,
424 ?string $shipmentState = null,
425 ?string $paymentState = null,
426 ?StateReference $state = null,
430 ?int $lastMessageSequenceNumber = null,
431 ?CustomFields $custom = null,
432 ?DateTimeImmutable $completedAt = null,
434 ?CreatedBy $createdBy = null
435 ) {
436 $this->id = $id;
437 $this->version = $version;
438 $this->createdAt = $createdAt;
439 $this->lastModifiedAt = $lastModifiedAt;
440 $this->orderNumber = $orderNumber;
441 $this->purchaseOrderNumber = $purchaseOrderNumber;
442 $this->customerId = $customerId;
443 $this->customerEmail = $customerEmail;
444 $this->customerGroup = $customerGroup;
445 $this->anonymousId = $anonymousId;
446 $this->businessUnit = $businessUnit;
447 $this->store = $store;
448 $this->lineItems = $lineItems;
449 $this->customLineItems = $customLineItems;
450 $this->totalPrice = $totalPrice;
451 $this->taxedPrice = $taxedPrice;
452 $this->taxedShippingPrice = $taxedShippingPrice;
453 $this->discountOnTotalPrice = $discountOnTotalPrice;
454 $this->taxMode = $taxMode;
455 $this->taxRoundingMode = $taxRoundingMode;
456 $this->taxCalculationMode = $taxCalculationMode;
457 $this->inventoryMode = $inventoryMode;
458 $this->billingAddress = $billingAddress;
459 $this->shippingAddress = $shippingAddress;
460 $this->shippingMode = $shippingMode;
461 $this->shippingKey = $shippingKey;
462 $this->shippingInfo = $shippingInfo;
463 $this->shippingRateInput = $shippingRateInput;
464 $this->shippingCustomFields = $shippingCustomFields;
465 $this->shipping = $shipping;
466 $this->itemShippingAddresses = $itemShippingAddresses;
467 $this->discountCodes = $discountCodes;
468 $this->directDiscounts = $directDiscounts;
469 $this->refusedGifts = $refusedGifts;
470 $this->paymentInfo = $paymentInfo;
471 $this->country = $country;
472 $this->locale = $locale;
473 $this->origin = $origin;
474 $this->cart = $cart;
475 $this->quote = $quote;
476 $this->orderState = $orderState;
477 $this->shipmentState = $shipmentState;
478 $this->paymentState = $paymentState;
479 $this->state = $state;
480 $this->syncInfo = $syncInfo;
481 $this->returnInfo = $returnInfo;
482 $this->discountTypeCombination = $discountTypeCombination;
483 $this->lastMessageSequenceNumber = $lastMessageSequenceNumber;
484 $this->custom = $custom;
485 $this->completedAt = $completedAt;
486 $this->lastModifiedBy = $lastModifiedBy;
487 $this->createdBy = $createdBy;
488 }
489
496 public function getId()
497 {
498 if (is_null($this->id)) {
500 $data = $this->raw(self::FIELD_ID);
501 if (is_null($data)) {
502 return null;
503 }
504 $this->id = (string) $data;
505 }
506
507 return $this->id;
508 }
509
516 public function getVersion()
517 {
518 if (is_null($this->version)) {
520 $data = $this->raw(self::FIELD_VERSION);
521 if (is_null($data)) {
522 return null;
523 }
524 $this->version = (int) $data;
525 }
526
527 return $this->version;
528 }
529
536 public function getCreatedAt()
537 {
538 if (is_null($this->createdAt)) {
540 $data = $this->raw(self::FIELD_CREATED_AT);
541 if (is_null($data)) {
542 return null;
543 }
544 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
545 if (false === $data) {
546 return null;
547 }
548 $this->createdAt = $data;
549 }
550
551 return $this->createdAt;
552 }
553
560 public function getLastModifiedAt()
561 {
562 if (is_null($this->lastModifiedAt)) {
564 $data = $this->raw(self::FIELD_LAST_MODIFIED_AT);
565 if (is_null($data)) {
566 return null;
567 }
568 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
569 if (false === $data) {
570 return null;
571 }
572 $this->lastModifiedAt = $data;
573 }
574
576 }
577
584 public function getOrderNumber()
585 {
586 if (is_null($this->orderNumber)) {
588 $data = $this->raw(self::FIELD_ORDER_NUMBER);
589 if (is_null($data)) {
590 return null;
591 }
592 $this->orderNumber = (string) $data;
593 }
594
595 return $this->orderNumber;
596 }
597
605 public function getPurchaseOrderNumber()
606 {
607 if (is_null($this->purchaseOrderNumber)) {
609 $data = $this->raw(self::FIELD_PURCHASE_ORDER_NUMBER);
610 if (is_null($data)) {
611 return null;
612 }
613 $this->purchaseOrderNumber = (string) $data;
614 }
615
617 }
618
625 public function getCustomerId()
626 {
627 if (is_null($this->customerId)) {
629 $data = $this->raw(self::FIELD_CUSTOMER_ID);
630 if (is_null($data)) {
631 return null;
632 }
633 $this->customerId = (string) $data;
634 }
635
636 return $this->customerId;
637 }
638
645 public function getCustomerEmail()
646 {
647 if (is_null($this->customerEmail)) {
649 $data = $this->raw(self::FIELD_CUSTOMER_EMAIL);
650 if (is_null($data)) {
651 return null;
652 }
653 $this->customerEmail = (string) $data;
654 }
655
657 }
658
666 public function getCustomerGroup()
667 {
668 if (is_null($this->customerGroup)) {
670 $data = $this->raw(self::FIELD_CUSTOMER_GROUP);
671 if (is_null($data)) {
672 return null;
673 }
674
675 $this->customerGroup = CustomerGroupReferenceModel::of($data);
676 }
677
679 }
680
687 public function getAnonymousId()
688 {
689 if (is_null($this->anonymousId)) {
691 $data = $this->raw(self::FIELD_ANONYMOUS_ID);
692 if (is_null($data)) {
693 return null;
694 }
695 $this->anonymousId = (string) $data;
696 }
697
698 return $this->anonymousId;
699 }
700
707 public function getBusinessUnit()
708 {
709 if (is_null($this->businessUnit)) {
711 $data = $this->raw(self::FIELD_BUSINESS_UNIT);
712 if (is_null($data)) {
713 return null;
714 }
715
716 $this->businessUnit = BusinessUnitKeyReferenceModel::of($data);
717 }
718
719 return $this->businessUnit;
720 }
721
728 public function getStore()
729 {
730 if (is_null($this->store)) {
732 $data = $this->raw(self::FIELD_STORE);
733 if (is_null($data)) {
734 return null;
735 }
736
737 $this->store = StoreKeyReferenceModel::of($data);
738 }
739
740 return $this->store;
741 }
742
749 public function getLineItems()
750 {
751 if (is_null($this->lineItems)) {
753 $data = $this->raw(self::FIELD_LINE_ITEMS);
754 if (is_null($data)) {
755 return null;
756 }
757 $this->lineItems = LineItemCollection::fromArray($data);
758 }
759
760 return $this->lineItems;
761 }
762
769 public function getCustomLineItems()
770 {
771 if (is_null($this->customLineItems)) {
773 $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEMS);
774 if (is_null($data)) {
775 return null;
776 }
777 $this->customLineItems = CustomLineItemCollection::fromArray($data);
778 }
779
781 }
782
791 public function getTotalPrice()
792 {
793 if (is_null($this->totalPrice)) {
795 $data = $this->raw(self::FIELD_TOTAL_PRICE);
796 if (is_null($data)) {
797 return null;
798 }
799
800 $this->totalPrice = CentPrecisionMoneyModel::of($data);
801 }
802
803 return $this->totalPrice;
804 }
805
816 public function getTaxedPrice()
817 {
818 if (is_null($this->taxedPrice)) {
820 $data = $this->raw(self::FIELD_TAXED_PRICE);
821 if (is_null($data)) {
822 return null;
823 }
824
825 $this->taxedPrice = TaxedPriceModel::of($data);
826 }
827
828 return $this->taxedPrice;
829 }
830
837 public function getTaxedShippingPrice()
838 {
839 if (is_null($this->taxedShippingPrice)) {
841 $data = $this->raw(self::FIELD_TAXED_SHIPPING_PRICE);
842 if (is_null($data)) {
843 return null;
844 }
845
846 $this->taxedShippingPrice = TaxedPriceModel::of($data);
847 }
848
850 }
851
858 public function getDiscountOnTotalPrice()
859 {
860 if (is_null($this->discountOnTotalPrice)) {
862 $data = $this->raw(self::FIELD_DISCOUNT_ON_TOTAL_PRICE);
863 if (is_null($data)) {
864 return null;
865 }
866
867 $this->discountOnTotalPrice = DiscountOnTotalPriceModel::of($data);
868 }
869
871 }
872
879 public function getTaxMode()
880 {
881 if (is_null($this->taxMode)) {
883 $data = $this->raw(self::FIELD_TAX_MODE);
884 if (is_null($data)) {
885 return null;
886 }
887 $this->taxMode = (string) $data;
888 }
889
890 return $this->taxMode;
891 }
892
899 public function getTaxRoundingMode()
900 {
901 if (is_null($this->taxRoundingMode)) {
903 $data = $this->raw(self::FIELD_TAX_ROUNDING_MODE);
904 if (is_null($data)) {
905 return null;
906 }
907 $this->taxRoundingMode = (string) $data;
908 }
909
911 }
912
919 public function getTaxCalculationMode()
920 {
921 if (is_null($this->taxCalculationMode)) {
923 $data = $this->raw(self::FIELD_TAX_CALCULATION_MODE);
924 if (is_null($data)) {
925 return null;
926 }
927 $this->taxCalculationMode = (string) $data;
928 }
929
931 }
932
939 public function getInventoryMode()
940 {
941 if (is_null($this->inventoryMode)) {
943 $data = $this->raw(self::FIELD_INVENTORY_MODE);
944 if (is_null($data)) {
945 return null;
946 }
947 $this->inventoryMode = (string) $data;
948 }
949
951 }
952
959 public function getBillingAddress()
960 {
961 if (is_null($this->billingAddress)) {
963 $data = $this->raw(self::FIELD_BILLING_ADDRESS);
964 if (is_null($data)) {
965 return null;
966 }
967
968 $this->billingAddress = AddressModel::of($data);
969 }
970
972 }
973
981 public function getShippingAddress()
982 {
983 if (is_null($this->shippingAddress)) {
985 $data = $this->raw(self::FIELD_SHIPPING_ADDRESS);
986 if (is_null($data)) {
987 return null;
988 }
989
990 $this->shippingAddress = AddressModel::of($data);
991 }
992
994 }
995
1002 public function getShippingMode()
1003 {
1004 if (is_null($this->shippingMode)) {
1006 $data = $this->raw(self::FIELD_SHIPPING_MODE);
1007 if (is_null($data)) {
1008 return null;
1009 }
1010 $this->shippingMode = (string) $data;
1011 }
1012
1013 return $this->shippingMode;
1014 }
1015
1022 public function getShippingKey()
1023 {
1024 if (is_null($this->shippingKey)) {
1026 $data = $this->raw(self::FIELD_SHIPPING_KEY);
1027 if (is_null($data)) {
1028 return null;
1029 }
1030 $this->shippingKey = (string) $data;
1031 }
1032
1033 return $this->shippingKey;
1034 }
1035
1043 public function getShippingInfo()
1044 {
1045 if (is_null($this->shippingInfo)) {
1047 $data = $this->raw(self::FIELD_SHIPPING_INFO);
1048 if (is_null($data)) {
1049 return null;
1050 }
1051
1052 $this->shippingInfo = ShippingInfoModel::of($data);
1053 }
1054
1055 return $this->shippingInfo;
1056 }
1057
1070 public function getShippingRateInput()
1071 {
1072 if (is_null($this->shippingRateInput)) {
1074 $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT);
1075 if (is_null($data)) {
1076 return null;
1077 }
1078 $className = ShippingRateInputModel::resolveDiscriminatorClass($data);
1079 $this->shippingRateInput = $className::of($data);
1080 }
1081
1083 }
1084
1091 public function getShippingCustomFields()
1092 {
1093 if (is_null($this->shippingCustomFields)) {
1095 $data = $this->raw(self::FIELD_SHIPPING_CUSTOM_FIELDS);
1096 if (is_null($data)) {
1097 return null;
1098 }
1099
1100 $this->shippingCustomFields = CustomFieldsModel::of($data);
1101 }
1102
1104 }
1105
1113 public function getShipping()
1114 {
1115 if (is_null($this->shipping)) {
1117 $data = $this->raw(self::FIELD_SHIPPING);
1118 if (is_null($data)) {
1119 return null;
1120 }
1121 $this->shipping = ShippingCollection::fromArray($data);
1122 }
1123
1124 return $this->shipping;
1125 }
1126
1135 {
1136 if (is_null($this->itemShippingAddresses)) {
1138 $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES);
1139 if (is_null($data)) {
1140 return null;
1141 }
1142 $this->itemShippingAddresses = AddressCollection::fromArray($data);
1143 }
1144
1146 }
1147
1155 public function getDiscountCodes()
1156 {
1157 if (is_null($this->discountCodes)) {
1159 $data = $this->raw(self::FIELD_DISCOUNT_CODES);
1160 if (is_null($data)) {
1161 return null;
1162 }
1163 $this->discountCodes = DiscountCodeInfoCollection::fromArray($data);
1164 }
1165
1166 return $this->discountCodes;
1167 }
1168
1176 public function getDirectDiscounts()
1177 {
1178 if (is_null($this->directDiscounts)) {
1180 $data = $this->raw(self::FIELD_DIRECT_DISCOUNTS);
1181 if (is_null($data)) {
1182 return null;
1183 }
1184 $this->directDiscounts = DirectDiscountCollection::fromArray($data);
1185 }
1186
1188 }
1189
1196 public function getRefusedGifts()
1197 {
1198 if (is_null($this->refusedGifts)) {
1200 $data = $this->raw(self::FIELD_REFUSED_GIFTS);
1201 if (is_null($data)) {
1202 return null;
1203 }
1204 $this->refusedGifts = CartDiscountReferenceCollection::fromArray($data);
1205 }
1206
1207 return $this->refusedGifts;
1208 }
1209
1216 public function getPaymentInfo()
1217 {
1218 if (is_null($this->paymentInfo)) {
1220 $data = $this->raw(self::FIELD_PAYMENT_INFO);
1221 if (is_null($data)) {
1222 return null;
1223 }
1224
1225 $this->paymentInfo = PaymentInfoModel::of($data);
1226 }
1227
1228 return $this->paymentInfo;
1229 }
1230
1237 public function getCountry()
1238 {
1239 if (is_null($this->country)) {
1241 $data = $this->raw(self::FIELD_COUNTRY);
1242 if (is_null($data)) {
1243 return null;
1244 }
1245 $this->country = (string) $data;
1246 }
1247
1248 return $this->country;
1249 }
1250
1258 public function getLocale()
1259 {
1260 if (is_null($this->locale)) {
1262 $data = $this->raw(self::FIELD_LOCALE);
1263 if (is_null($data)) {
1264 return null;
1265 }
1266 $this->locale = (string) $data;
1267 }
1268
1269 return $this->locale;
1270 }
1271
1278 public function getOrigin()
1279 {
1280 if (is_null($this->origin)) {
1282 $data = $this->raw(self::FIELD_ORIGIN);
1283 if (is_null($data)) {
1284 return null;
1285 }
1286 $this->origin = (string) $data;
1287 }
1288
1289 return $this->origin;
1290 }
1291
1299 public function getCart()
1300 {
1301 if (is_null($this->cart)) {
1303 $data = $this->raw(self::FIELD_CART);
1304 if (is_null($data)) {
1305 return null;
1306 }
1307
1308 $this->cart = CartReferenceModel::of($data);
1309 }
1310
1311 return $this->cart;
1312 }
1313
1320 public function getQuote()
1321 {
1322 if (is_null($this->quote)) {
1324 $data = $this->raw(self::FIELD_QUOTE);
1325 if (is_null($data)) {
1326 return null;
1327 }
1328
1329 $this->quote = QuoteReferenceModel::of($data);
1330 }
1331
1332 return $this->quote;
1333 }
1334
1341 public function getOrderState()
1342 {
1343 if (is_null($this->orderState)) {
1345 $data = $this->raw(self::FIELD_ORDER_STATE);
1346 if (is_null($data)) {
1347 return null;
1348 }
1349 $this->orderState = (string) $data;
1350 }
1351
1352 return $this->orderState;
1353 }
1354
1361 public function getShipmentState()
1362 {
1363 if (is_null($this->shipmentState)) {
1365 $data = $this->raw(self::FIELD_SHIPMENT_STATE);
1366 if (is_null($data)) {
1367 return null;
1368 }
1369 $this->shipmentState = (string) $data;
1370 }
1371
1372 return $this->shipmentState;
1373 }
1374
1381 public function getPaymentState()
1382 {
1383 if (is_null($this->paymentState)) {
1385 $data = $this->raw(self::FIELD_PAYMENT_STATE);
1386 if (is_null($data)) {
1387 return null;
1388 }
1389 $this->paymentState = (string) $data;
1390 }
1391
1392 return $this->paymentState;
1393 }
1394
1402 public function getState()
1403 {
1404 if (is_null($this->state)) {
1406 $data = $this->raw(self::FIELD_STATE);
1407 if (is_null($data)) {
1408 return null;
1409 }
1410
1411 $this->state = StateReferenceModel::of($data);
1412 }
1413
1414 return $this->state;
1415 }
1416
1424 public function getSyncInfo()
1425 {
1426 if (is_null($this->syncInfo)) {
1428 $data = $this->raw(self::FIELD_SYNC_INFO);
1429 if (is_null($data)) {
1430 return null;
1431 }
1432 $this->syncInfo = SyncInfoCollection::fromArray($data);
1433 }
1434
1435 return $this->syncInfo;
1436 }
1437
1444 public function getReturnInfo()
1445 {
1446 if (is_null($this->returnInfo)) {
1448 $data = $this->raw(self::FIELD_RETURN_INFO);
1449 if (is_null($data)) {
1450 return null;
1451 }
1452 $this->returnInfo = ReturnInfoCollection::fromArray($data);
1453 }
1454
1455 return $this->returnInfo;
1456 }
1457
1465 {
1466 if (is_null($this->discountTypeCombination)) {
1468 $data = $this->raw(self::FIELD_DISCOUNT_TYPE_COMBINATION);
1469 if (is_null($data)) {
1470 return null;
1471 }
1473 $this->discountTypeCombination = $className::of($data);
1474 }
1475
1477 }
1478
1486 {
1487 if (is_null($this->lastMessageSequenceNumber)) {
1489 $data = $this->raw(self::FIELD_LAST_MESSAGE_SEQUENCE_NUMBER);
1490 if (is_null($data)) {
1491 return null;
1492 }
1493 $this->lastMessageSequenceNumber = (int) $data;
1494 }
1495
1497 }
1498
1505 public function getCustom()
1506 {
1507 if (is_null($this->custom)) {
1509 $data = $this->raw(self::FIELD_CUSTOM);
1510 if (is_null($data)) {
1511 return null;
1512 }
1513
1514 $this->custom = CustomFieldsModel::of($data);
1515 }
1516
1517 return $this->custom;
1518 }
1519
1527 public function getCompletedAt()
1528 {
1529 if (is_null($this->completedAt)) {
1531 $data = $this->raw(self::FIELD_COMPLETED_AT);
1532 if (is_null($data)) {
1533 return null;
1534 }
1535 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
1536 if (false === $data) {
1537 return null;
1538 }
1539 $this->completedAt = $data;
1540 }
1541
1542 return $this->completedAt;
1543 }
1544
1551 public function getLastModifiedBy()
1552 {
1553 if (is_null($this->lastModifiedBy)) {
1555 $data = $this->raw(self::FIELD_LAST_MODIFIED_BY);
1556 if (is_null($data)) {
1557 return null;
1558 }
1559
1560 $this->lastModifiedBy = LastModifiedByModel::of($data);
1561 }
1562
1563 return $this->lastModifiedBy;
1564 }
1565
1572 public function getCreatedBy()
1573 {
1574 if (is_null($this->createdBy)) {
1576 $data = $this->raw(self::FIELD_CREATED_BY);
1577 if (is_null($data)) {
1578 return null;
1579 }
1580
1581 $this->createdBy = CreatedByModel::of($data);
1582 }
1583
1584 return $this->createdBy;
1585 }
1586
1587
1591 public function setId(?string $id): void
1592 {
1593 $this->id = $id;
1594 }
1595
1599 public function setVersion(?int $version): void
1600 {
1601 $this->version = $version;
1602 }
1603
1607 public function setCreatedAt(?DateTimeImmutable $createdAt): void
1608 {
1609 $this->createdAt = $createdAt;
1610 }
1611
1615 public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void
1616 {
1617 $this->lastModifiedAt = $lastModifiedAt;
1618 }
1619
1623 public function setOrderNumber(?string $orderNumber): void
1624 {
1625 $this->orderNumber = $orderNumber;
1626 }
1627
1631 public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void
1632 {
1633 $this->purchaseOrderNumber = $purchaseOrderNumber;
1634 }
1635
1639 public function setCustomerId(?string $customerId): void
1640 {
1641 $this->customerId = $customerId;
1642 }
1643
1647 public function setCustomerEmail(?string $customerEmail): void
1648 {
1649 $this->customerEmail = $customerEmail;
1650 }
1651
1656 {
1657 $this->customerGroup = $customerGroup;
1658 }
1659
1663 public function setAnonymousId(?string $anonymousId): void
1664 {
1665 $this->anonymousId = $anonymousId;
1666 }
1667
1672 {
1673 $this->businessUnit = $businessUnit;
1674 }
1675
1679 public function setStore(?StoreKeyReference $store): void
1680 {
1681 $this->store = $store;
1682 }
1683
1688 {
1689 $this->lineItems = $lineItems;
1690 }
1691
1696 {
1697 $this->customLineItems = $customLineItems;
1698 }
1699
1704 {
1705 $this->totalPrice = $totalPrice;
1706 }
1707
1711 public function setTaxedPrice(?TaxedPrice $taxedPrice): void
1712 {
1713 $this->taxedPrice = $taxedPrice;
1714 }
1715
1720 {
1721 $this->taxedShippingPrice = $taxedShippingPrice;
1722 }
1723
1728 {
1729 $this->discountOnTotalPrice = $discountOnTotalPrice;
1730 }
1731
1735 public function setTaxMode(?string $taxMode): void
1736 {
1737 $this->taxMode = $taxMode;
1738 }
1739
1743 public function setTaxRoundingMode(?string $taxRoundingMode): void
1744 {
1745 $this->taxRoundingMode = $taxRoundingMode;
1746 }
1747
1751 public function setTaxCalculationMode(?string $taxCalculationMode): void
1752 {
1753 $this->taxCalculationMode = $taxCalculationMode;
1754 }
1755
1759 public function setInventoryMode(?string $inventoryMode): void
1760 {
1761 $this->inventoryMode = $inventoryMode;
1762 }
1763
1768 {
1769 $this->billingAddress = $billingAddress;
1770 }
1771
1776 {
1777 $this->shippingAddress = $shippingAddress;
1778 }
1779
1783 public function setShippingMode(?string $shippingMode): void
1784 {
1785 $this->shippingMode = $shippingMode;
1786 }
1787
1791 public function setShippingKey(?string $shippingKey): void
1792 {
1793 $this->shippingKey = $shippingKey;
1794 }
1795
1800 {
1801 $this->shippingInfo = $shippingInfo;
1802 }
1803
1808 {
1809 $this->shippingRateInput = $shippingRateInput;
1810 }
1811
1816 {
1817 $this->shippingCustomFields = $shippingCustomFields;
1818 }
1819
1824 {
1825 $this->shipping = $shipping;
1826 }
1827
1832 {
1833 $this->itemShippingAddresses = $itemShippingAddresses;
1834 }
1835
1840 {
1841 $this->discountCodes = $discountCodes;
1842 }
1843
1848 {
1849 $this->directDiscounts = $directDiscounts;
1850 }
1851
1856 {
1857 $this->refusedGifts = $refusedGifts;
1858 }
1859
1864 {
1865 $this->paymentInfo = $paymentInfo;
1866 }
1867
1871 public function setCountry(?string $country): void
1872 {
1873 $this->country = $country;
1874 }
1875
1879 public function setLocale(?string $locale): void
1880 {
1881 $this->locale = $locale;
1882 }
1883
1887 public function setOrigin(?string $origin): void
1888 {
1889 $this->origin = $origin;
1890 }
1891
1895 public function setCart(?CartReference $cart): void
1896 {
1897 $this->cart = $cart;
1898 }
1899
1903 public function setQuote(?QuoteReference $quote): void
1904 {
1905 $this->quote = $quote;
1906 }
1907
1911 public function setOrderState(?string $orderState): void
1912 {
1913 $this->orderState = $orderState;
1914 }
1915
1919 public function setShipmentState(?string $shipmentState): void
1920 {
1921 $this->shipmentState = $shipmentState;
1922 }
1923
1927 public function setPaymentState(?string $paymentState): void
1928 {
1929 $this->paymentState = $paymentState;
1930 }
1931
1935 public function setState(?StateReference $state): void
1936 {
1937 $this->state = $state;
1938 }
1939
1944 {
1945 $this->syncInfo = $syncInfo;
1946 }
1947
1952 {
1953 $this->returnInfo = $returnInfo;
1954 }
1955
1960 {
1961 $this->discountTypeCombination = $discountTypeCombination;
1962 }
1963
1968 {
1969 $this->lastMessageSequenceNumber = $lastMessageSequenceNumber;
1970 }
1971
1975 public function setCustom(?CustomFields $custom): void
1976 {
1977 $this->custom = $custom;
1978 }
1979
1983 public function setCompletedAt(?DateTimeImmutable $completedAt): void
1984 {
1985 $this->completedAt = $completedAt;
1986 }
1987
1992 {
1993 $this->lastModifiedBy = $lastModifiedBy;
1994 }
1995
1999 public function setCreatedBy(?CreatedBy $createdBy): void
2000 {
2001 $this->createdBy = $createdBy;
2002 }
2003
2004
2005 #[\ReturnTypeWillChange]
2006 public function jsonSerialize()
2007 {
2008 $data = $this->toArray();
2009 if (isset($data[Order::FIELD_CREATED_AT]) && $data[Order::FIELD_CREATED_AT] instanceof \DateTimeImmutable) {
2010 $data[Order::FIELD_CREATED_AT] = $data[Order::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c');
2011 }
2012
2013 if (isset($data[Order::FIELD_LAST_MODIFIED_AT]) && $data[Order::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) {
2014 $data[Order::FIELD_LAST_MODIFIED_AT] = $data[Order::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c');
2015 }
2016
2017 if (isset($data[Order::FIELD_COMPLETED_AT]) && $data[Order::FIELD_COMPLETED_AT] instanceof \DateTimeImmutable) {
2018 $data[Order::FIELD_COMPLETED_AT] = $data[Order::FIELD_COMPLETED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c');
2019 }
2020 return (object) $data;
2021 }
2022}
setDirectDiscounts(?DirectDiscountCollection $directDiscounts)
setItemShippingAddresses(?AddressCollection $itemShippingAddresses)
__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 $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, ?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)
setShippingRateInput(?ShippingRateInput $shippingRateInput)
setSyncInfo(?SyncInfoCollection $syncInfo)
setCustomerGroup(?CustomerGroupReference $customerGroup)
setShippingInfo(?ShippingInfo $shippingInfo)
setDiscountTypeCombination(?DiscountTypeCombination $discountTypeCombination)
setShippingAddress(?Address $shippingAddress)
setTaxRoundingMode(?string $taxRoundingMode)
setTaxCalculationMode(?string $taxCalculationMode)
setDiscountOnTotalPrice(?DiscountOnTotalPrice $discountOnTotalPrice)
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)
setBillingAddress(?Address $billingAddress)
setLineItems(?LineItemCollection $lineItems)
setLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
setStore(?StoreKeyReference $store)
setShipping(?ShippingCollection $shipping)
setLastMessageSequenceNumber(?int $lastMessageSequenceNumber)
static fromArray(array $data)