commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
All Classes Namespaces Functions Variables Pages
CartModel.php
1<?php
2
3declare(strict_types=1);
10
37use DateTimeImmutable;
38use stdClass;
39
43final class CartModel extends JsonObjectModel implements Cart
44{
49 protected $id;
50
55 protected $version;
56
61 protected $createdAt;
62
67 protected $lastModifiedAt;
68
73 protected $key;
74
79 protected $customerId;
80
85 protected $customerEmail;
86
91 protected $customerGroup;
92
97 protected $anonymousId;
98
103 protected $businessUnit;
104
109 protected $store;
110
115 protected $lineItems;
116
122
128
133 protected $totalPrice;
134
139 protected $taxedPrice;
140
146
152
157 protected $taxMode;
158
164
170
175 protected $inventoryMode;
176
181 protected $cartState;
182
188
194
199 protected $shippingMode;
200
205 protected $shippingKey;
206
211 protected $shippingInfo;
212
218
224
229 protected $shipping;
230
236
241 protected $discountCodes;
242
248
253 protected $refusedGifts;
254
259 protected $paymentInfo;
260
265 protected $country;
266
271 protected $locale;
272
277 protected $origin;
278
283 protected $custom;
284
290
296
302
307 protected $createdBy;
308
309
313 public function __construct(
314 ?string $id = null,
315 ?int $version = null,
316 ?DateTimeImmutable $createdAt = null,
317 ?DateTimeImmutable $lastModifiedAt = null,
318 ?string $key = null,
319 ?string $customerId = null,
320 ?string $customerEmail = null,
322 ?string $anonymousId = null,
327 ?int $totalLineItemQuantity = null,
329 ?TaxedPrice $taxedPrice = null,
332 ?string $taxMode = null,
333 ?string $taxRoundingMode = null,
334 ?string $taxCalculationMode = null,
335 ?string $inventoryMode = null,
336 ?string $cartState = null,
337 ?Address $billingAddress = null,
339 ?string $shippingMode = null,
340 ?string $shippingKey = null,
350 ?string $country = null,
351 ?string $locale = null,
352 ?string $origin = null,
353 ?CustomFields $custom = null,
357 ?CreatedBy $createdBy = null
358 ) {
359 $this->id = $id;
360 $this->version = $version;
361 $this->createdAt = $createdAt;
362 $this->lastModifiedAt = $lastModifiedAt;
363 $this->key = $key;
364 $this->customerId = $customerId;
365 $this->customerEmail = $customerEmail;
366 $this->customerGroup = $customerGroup;
367 $this->anonymousId = $anonymousId;
368 $this->businessUnit = $businessUnit;
369 $this->store = $store;
370 $this->lineItems = $lineItems;
371 $this->customLineItems = $customLineItems;
372 $this->totalLineItemQuantity = $totalLineItemQuantity;
373 $this->totalPrice = $totalPrice;
374 $this->taxedPrice = $taxedPrice;
375 $this->taxedShippingPrice = $taxedShippingPrice;
376 $this->discountOnTotalPrice = $discountOnTotalPrice;
377 $this->taxMode = $taxMode;
378 $this->taxRoundingMode = $taxRoundingMode;
379 $this->taxCalculationMode = $taxCalculationMode;
380 $this->inventoryMode = $inventoryMode;
381 $this->cartState = $cartState;
382 $this->billingAddress = $billingAddress;
383 $this->shippingAddress = $shippingAddress;
384 $this->shippingMode = $shippingMode;
385 $this->shippingKey = $shippingKey;
386 $this->shippingInfo = $shippingInfo;
387 $this->shippingRateInput = $shippingRateInput;
388 $this->shippingCustomFields = $shippingCustomFields;
389 $this->shipping = $shipping;
390 $this->itemShippingAddresses = $itemShippingAddresses;
391 $this->discountCodes = $discountCodes;
392 $this->directDiscounts = $directDiscounts;
393 $this->refusedGifts = $refusedGifts;
394 $this->paymentInfo = $paymentInfo;
395 $this->country = $country;
396 $this->locale = $locale;
397 $this->origin = $origin;
398 $this->custom = $custom;
399 $this->discountTypeCombination = $discountTypeCombination;
400 $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification;
401 $this->lastModifiedBy = $lastModifiedBy;
402 $this->createdBy = $createdBy;
403 }
404
411 public function getId()
412 {
413 if (is_null($this->id)) {
415 $data = $this->raw(self::FIELD_ID);
416 if (is_null($data)) {
417 return null;
418 }
419 $this->id = (string) $data;
420 }
421
422 return $this->id;
423 }
424
431 public function getVersion()
432 {
433 if (is_null($this->version)) {
435 $data = $this->raw(self::FIELD_VERSION);
436 if (is_null($data)) {
437 return null;
438 }
439 $this->version = (int) $data;
440 }
441
442 return $this->version;
443 }
444
451 public function getCreatedAt()
452 {
453 if (is_null($this->createdAt)) {
455 $data = $this->raw(self::FIELD_CREATED_AT);
456 if (is_null($data)) {
457 return null;
458 }
459 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
460 if (false === $data) {
461 return null;
462 }
463 $this->createdAt = $data;
464 }
465
466 return $this->createdAt;
467 }
468
475 public function getLastModifiedAt()
476 {
477 if (is_null($this->lastModifiedAt)) {
479 $data = $this->raw(self::FIELD_LAST_MODIFIED_AT);
480 if (is_null($data)) {
481 return null;
482 }
483 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
484 if (false === $data) {
485 return null;
486 }
487 $this->lastModifiedAt = $data;
488 }
489
491 }
492
499 public function getKey()
500 {
501 if (is_null($this->key)) {
503 $data = $this->raw(self::FIELD_KEY);
504 if (is_null($data)) {
505 return null;
506 }
507 $this->key = (string) $data;
508 }
509
510 return $this->key;
511 }
512
519 public function getCustomerId()
520 {
521 if (is_null($this->customerId)) {
523 $data = $this->raw(self::FIELD_CUSTOMER_ID);
524 if (is_null($data)) {
525 return null;
526 }
527 $this->customerId = (string) $data;
528 }
529
530 return $this->customerId;
531 }
532
539 public function getCustomerEmail()
540 {
541 if (is_null($this->customerEmail)) {
543 $data = $this->raw(self::FIELD_CUSTOMER_EMAIL);
544 if (is_null($data)) {
545 return null;
546 }
547 $this->customerEmail = (string) $data;
548 }
549
551 }
552
559 public function getCustomerGroup()
560 {
561 if (is_null($this->customerGroup)) {
563 $data = $this->raw(self::FIELD_CUSTOMER_GROUP);
564 if (is_null($data)) {
565 return null;
566 }
567
568 $this->customerGroup = CustomerGroupReferenceModel::of($data);
569 }
570
572 }
573
580 public function getAnonymousId()
581 {
582 if (is_null($this->anonymousId)) {
584 $data = $this->raw(self::FIELD_ANONYMOUS_ID);
585 if (is_null($data)) {
586 return null;
587 }
588 $this->anonymousId = (string) $data;
589 }
590
591 return $this->anonymousId;
592 }
593
600 public function getBusinessUnit()
601 {
602 if (is_null($this->businessUnit)) {
604 $data = $this->raw(self::FIELD_BUSINESS_UNIT);
605 if (is_null($data)) {
606 return null;
607 }
608
609 $this->businessUnit = BusinessUnitKeyReferenceModel::of($data);
610 }
611
612 return $this->businessUnit;
613 }
614
621 public function getStore()
622 {
623 if (is_null($this->store)) {
625 $data = $this->raw(self::FIELD_STORE);
626 if (is_null($data)) {
627 return null;
628 }
629
630 $this->store = StoreKeyReferenceModel::of($data);
631 }
632
633 return $this->store;
634 }
635
642 public function getLineItems()
643 {
644 if (is_null($this->lineItems)) {
646 $data = $this->raw(self::FIELD_LINE_ITEMS);
647 if (is_null($data)) {
648 return null;
649 }
650 $this->lineItems = LineItemCollection::fromArray($data);
651 }
652
653 return $this->lineItems;
654 }
655
662 public function getCustomLineItems()
663 {
664 if (is_null($this->customLineItems)) {
666 $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEMS);
667 if (is_null($data)) {
668 return null;
669 }
670 $this->customLineItems = CustomLineItemCollection::fromArray($data);
671 }
672
674 }
675
682 public function getTotalLineItemQuantity()
683 {
684 if (is_null($this->totalLineItemQuantity)) {
686 $data = $this->raw(self::FIELD_TOTAL_LINE_ITEM_QUANTITY);
687 if (is_null($data)) {
688 return null;
689 }
690 $this->totalLineItemQuantity = (int) $data;
691 }
692
694 }
695
704 public function getTotalPrice()
705 {
706 if (is_null($this->totalPrice)) {
708 $data = $this->raw(self::FIELD_TOTAL_PRICE);
709 if (is_null($data)) {
710 return null;
711 }
712
713 $this->totalPrice = CentPrecisionMoneyModel::of($data);
714 }
715
716 return $this->totalPrice;
717 }
718
729 public function getTaxedPrice()
730 {
731 if (is_null($this->taxedPrice)) {
733 $data = $this->raw(self::FIELD_TAXED_PRICE);
734 if (is_null($data)) {
735 return null;
736 }
737
738 $this->taxedPrice = TaxedPriceModel::of($data);
739 }
740
741 return $this->taxedPrice;
742 }
743
750 public function getTaxedShippingPrice()
751 {
752 if (is_null($this->taxedShippingPrice)) {
754 $data = $this->raw(self::FIELD_TAXED_SHIPPING_PRICE);
755 if (is_null($data)) {
756 return null;
757 }
758
759 $this->taxedShippingPrice = TaxedPriceModel::of($data);
760 }
761
763 }
764
771 public function getDiscountOnTotalPrice()
772 {
773 if (is_null($this->discountOnTotalPrice)) {
775 $data = $this->raw(self::FIELD_DISCOUNT_ON_TOTAL_PRICE);
776 if (is_null($data)) {
777 return null;
778 }
779
780 $this->discountOnTotalPrice = DiscountOnTotalPriceModel::of($data);
781 }
782
784 }
785
792 public function getTaxMode()
793 {
794 if (is_null($this->taxMode)) {
796 $data = $this->raw(self::FIELD_TAX_MODE);
797 if (is_null($data)) {
798 return null;
799 }
800 $this->taxMode = (string) $data;
801 }
802
803 return $this->taxMode;
804 }
805
812 public function getTaxRoundingMode()
813 {
814 if (is_null($this->taxRoundingMode)) {
816 $data = $this->raw(self::FIELD_TAX_ROUNDING_MODE);
817 if (is_null($data)) {
818 return null;
819 }
820 $this->taxRoundingMode = (string) $data;
821 }
822
824 }
825
832 public function getTaxCalculationMode()
833 {
834 if (is_null($this->taxCalculationMode)) {
836 $data = $this->raw(self::FIELD_TAX_CALCULATION_MODE);
837 if (is_null($data)) {
838 return null;
839 }
840 $this->taxCalculationMode = (string) $data;
841 }
842
844 }
845
852 public function getInventoryMode()
853 {
854 if (is_null($this->inventoryMode)) {
856 $data = $this->raw(self::FIELD_INVENTORY_MODE);
857 if (is_null($data)) {
858 return null;
859 }
860 $this->inventoryMode = (string) $data;
861 }
862
864 }
865
872 public function getCartState()
873 {
874 if (is_null($this->cartState)) {
876 $data = $this->raw(self::FIELD_CART_STATE);
877 if (is_null($data)) {
878 return null;
879 }
880 $this->cartState = (string) $data;
881 }
882
883 return $this->cartState;
884 }
885
892 public function getBillingAddress()
893 {
894 if (is_null($this->billingAddress)) {
896 $data = $this->raw(self::FIELD_BILLING_ADDRESS);
897 if (is_null($data)) {
898 return null;
899 }
900
901 $this->billingAddress = AddressModel::of($data);
902 }
903
905 }
906
913 public function getShippingAddress()
914 {
915 if (is_null($this->shippingAddress)) {
917 $data = $this->raw(self::FIELD_SHIPPING_ADDRESS);
918 if (is_null($data)) {
919 return null;
920 }
921
922 $this->shippingAddress = AddressModel::of($data);
923 }
924
926 }
927
934 public function getShippingMode()
935 {
936 if (is_null($this->shippingMode)) {
938 $data = $this->raw(self::FIELD_SHIPPING_MODE);
939 if (is_null($data)) {
940 return null;
941 }
942 $this->shippingMode = (string) $data;
943 }
944
945 return $this->shippingMode;
946 }
947
954 public function getShippingKey()
955 {
956 if (is_null($this->shippingKey)) {
958 $data = $this->raw(self::FIELD_SHIPPING_KEY);
959 if (is_null($data)) {
960 return null;
961 }
962 $this->shippingKey = (string) $data;
963 }
964
965 return $this->shippingKey;
966 }
967
974 public function getShippingInfo()
975 {
976 if (is_null($this->shippingInfo)) {
978 $data = $this->raw(self::FIELD_SHIPPING_INFO);
979 if (is_null($data)) {
980 return null;
981 }
982
983 $this->shippingInfo = ShippingInfoModel::of($data);
984 }
985
986 return $this->shippingInfo;
987 }
988
1001 public function getShippingRateInput()
1002 {
1003 if (is_null($this->shippingRateInput)) {
1005 $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT);
1006 if (is_null($data)) {
1007 return null;
1008 }
1010 $this->shippingRateInput = $className::of($data);
1011 }
1012
1014 }
1015
1022 public function getShippingCustomFields()
1023 {
1024 if (is_null($this->shippingCustomFields)) {
1026 $data = $this->raw(self::FIELD_SHIPPING_CUSTOM_FIELDS);
1027 if (is_null($data)) {
1028 return null;
1029 }
1030
1031 $this->shippingCustomFields = CustomFieldsModel::of($data);
1032 }
1033
1035 }
1036
1043 public function getShipping()
1044 {
1045 if (is_null($this->shipping)) {
1047 $data = $this->raw(self::FIELD_SHIPPING);
1048 if (is_null($data)) {
1049 return null;
1050 }
1051 $this->shipping = ShippingCollection::fromArray($data);
1052 }
1053
1054 return $this->shipping;
1055 }
1056
1065 {
1066 if (is_null($this->itemShippingAddresses)) {
1068 $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES);
1069 if (is_null($data)) {
1070 return null;
1071 }
1072 $this->itemShippingAddresses = AddressCollection::fromArray($data);
1073 }
1074
1076 }
1077
1084 public function getDiscountCodes()
1085 {
1086 if (is_null($this->discountCodes)) {
1088 $data = $this->raw(self::FIELD_DISCOUNT_CODES);
1089 if (is_null($data)) {
1090 return null;
1091 }
1092 $this->discountCodes = DiscountCodeInfoCollection::fromArray($data);
1093 }
1094
1095 return $this->discountCodes;
1096 }
1097
1104 public function getDirectDiscounts()
1105 {
1106 if (is_null($this->directDiscounts)) {
1108 $data = $this->raw(self::FIELD_DIRECT_DISCOUNTS);
1109 if (is_null($data)) {
1110 return null;
1111 }
1112 $this->directDiscounts = DirectDiscountCollection::fromArray($data);
1113 }
1114
1116 }
1117
1124 public function getRefusedGifts()
1125 {
1126 if (is_null($this->refusedGifts)) {
1128 $data = $this->raw(self::FIELD_REFUSED_GIFTS);
1129 if (is_null($data)) {
1130 return null;
1131 }
1132 $this->refusedGifts = CartDiscountReferenceCollection::fromArray($data);
1133 }
1134
1135 return $this->refusedGifts;
1136 }
1137
1144 public function getPaymentInfo()
1145 {
1146 if (is_null($this->paymentInfo)) {
1148 $data = $this->raw(self::FIELD_PAYMENT_INFO);
1149 if (is_null($data)) {
1150 return null;
1151 }
1152
1153 $this->paymentInfo = PaymentInfoModel::of($data);
1154 }
1155
1156 return $this->paymentInfo;
1157 }
1158
1165 public function getCountry()
1166 {
1167 if (is_null($this->country)) {
1169 $data = $this->raw(self::FIELD_COUNTRY);
1170 if (is_null($data)) {
1171 return null;
1172 }
1173 $this->country = (string) $data;
1174 }
1175
1176 return $this->country;
1177 }
1178
1185 public function getLocale()
1186 {
1187 if (is_null($this->locale)) {
1189 $data = $this->raw(self::FIELD_LOCALE);
1190 if (is_null($data)) {
1191 return null;
1192 }
1193 $this->locale = (string) $data;
1194 }
1195
1196 return $this->locale;
1197 }
1198
1205 public function getOrigin()
1206 {
1207 if (is_null($this->origin)) {
1209 $data = $this->raw(self::FIELD_ORIGIN);
1210 if (is_null($data)) {
1211 return null;
1212 }
1213 $this->origin = (string) $data;
1214 }
1215
1216 return $this->origin;
1217 }
1218
1225 public function getCustom()
1226 {
1227 if (is_null($this->custom)) {
1229 $data = $this->raw(self::FIELD_CUSTOM);
1230 if (is_null($data)) {
1231 return null;
1232 }
1233
1234 $this->custom = CustomFieldsModel::of($data);
1235 }
1236
1237 return $this->custom;
1238 }
1239
1247 {
1248 if (is_null($this->discountTypeCombination)) {
1250 $data = $this->raw(self::FIELD_DISCOUNT_TYPE_COMBINATION);
1251 if (is_null($data)) {
1252 return null;
1253 }
1255 $this->discountTypeCombination = $className::of($data);
1256 }
1257
1259 }
1260
1268 {
1269 if (is_null($this->deleteDaysAfterLastModification)) {
1271 $data = $this->raw(self::FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION);
1272 if (is_null($data)) {
1273 return null;
1274 }
1275 $this->deleteDaysAfterLastModification = (int) $data;
1276 }
1277
1279 }
1280
1287 public function getLastModifiedBy()
1288 {
1289 if (is_null($this->lastModifiedBy)) {
1291 $data = $this->raw(self::FIELD_LAST_MODIFIED_BY);
1292 if (is_null($data)) {
1293 return null;
1294 }
1295
1296 $this->lastModifiedBy = LastModifiedByModel::of($data);
1297 }
1298
1299 return $this->lastModifiedBy;
1300 }
1301
1308 public function getCreatedBy()
1309 {
1310 if (is_null($this->createdBy)) {
1312 $data = $this->raw(self::FIELD_CREATED_BY);
1313 if (is_null($data)) {
1314 return null;
1315 }
1316
1317 $this->createdBy = CreatedByModel::of($data);
1318 }
1319
1320 return $this->createdBy;
1321 }
1322
1323
1327 public function setId(?string $id): void
1328 {
1329 $this->id = $id;
1330 }
1331
1335 public function setVersion(?int $version): void
1336 {
1337 $this->version = $version;
1338 }
1339
1343 public function setCreatedAt(?DateTimeImmutable $createdAt): void
1344 {
1345 $this->createdAt = $createdAt;
1346 }
1347
1351 public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void
1352 {
1353 $this->lastModifiedAt = $lastModifiedAt;
1354 }
1355
1359 public function setKey(?string $key): void
1360 {
1361 $this->key = $key;
1362 }
1363
1367 public function setCustomerId(?string $customerId): void
1368 {
1369 $this->customerId = $customerId;
1370 }
1371
1375 public function setCustomerEmail(?string $customerEmail): void
1376 {
1377 $this->customerEmail = $customerEmail;
1378 }
1379
1384 {
1385 $this->customerGroup = $customerGroup;
1386 }
1387
1391 public function setAnonymousId(?string $anonymousId): void
1392 {
1393 $this->anonymousId = $anonymousId;
1394 }
1395
1400 {
1401 $this->businessUnit = $businessUnit;
1402 }
1403
1407 public function setStore(?StoreKeyReference $store): void
1408 {
1409 $this->store = $store;
1410 }
1411
1416 {
1417 $this->lineItems = $lineItems;
1418 }
1419
1424 {
1425 $this->customLineItems = $customLineItems;
1426 }
1427
1432 {
1433 $this->totalLineItemQuantity = $totalLineItemQuantity;
1434 }
1435
1440 {
1441 $this->totalPrice = $totalPrice;
1442 }
1443
1447 public function setTaxedPrice(?TaxedPrice $taxedPrice): void
1448 {
1449 $this->taxedPrice = $taxedPrice;
1450 }
1451
1456 {
1457 $this->taxedShippingPrice = $taxedShippingPrice;
1458 }
1459
1464 {
1465 $this->discountOnTotalPrice = $discountOnTotalPrice;
1466 }
1467
1471 public function setTaxMode(?string $taxMode): void
1472 {
1473 $this->taxMode = $taxMode;
1474 }
1475
1479 public function setTaxRoundingMode(?string $taxRoundingMode): void
1480 {
1481 $this->taxRoundingMode = $taxRoundingMode;
1482 }
1483
1487 public function setTaxCalculationMode(?string $taxCalculationMode): void
1488 {
1489 $this->taxCalculationMode = $taxCalculationMode;
1490 }
1491
1495 public function setInventoryMode(?string $inventoryMode): void
1496 {
1497 $this->inventoryMode = $inventoryMode;
1498 }
1499
1503 public function setCartState(?string $cartState): void
1504 {
1505 $this->cartState = $cartState;
1506 }
1507
1512 {
1513 $this->billingAddress = $billingAddress;
1514 }
1515
1520 {
1521 $this->shippingAddress = $shippingAddress;
1522 }
1523
1527 public function setShippingMode(?string $shippingMode): void
1528 {
1529 $this->shippingMode = $shippingMode;
1530 }
1531
1535 public function setShippingKey(?string $shippingKey): void
1536 {
1537 $this->shippingKey = $shippingKey;
1538 }
1539
1544 {
1545 $this->shippingInfo = $shippingInfo;
1546 }
1547
1552 {
1553 $this->shippingRateInput = $shippingRateInput;
1554 }
1555
1560 {
1561 $this->shippingCustomFields = $shippingCustomFields;
1562 }
1563
1568 {
1569 $this->shipping = $shipping;
1570 }
1571
1576 {
1577 $this->itemShippingAddresses = $itemShippingAddresses;
1578 }
1579
1584 {
1585 $this->discountCodes = $discountCodes;
1586 }
1587
1592 {
1593 $this->directDiscounts = $directDiscounts;
1594 }
1595
1600 {
1601 $this->refusedGifts = $refusedGifts;
1602 }
1603
1608 {
1609 $this->paymentInfo = $paymentInfo;
1610 }
1611
1615 public function setCountry(?string $country): void
1616 {
1617 $this->country = $country;
1618 }
1619
1623 public function setLocale(?string $locale): void
1624 {
1625 $this->locale = $locale;
1626 }
1627
1631 public function setOrigin(?string $origin): void
1632 {
1633 $this->origin = $origin;
1634 }
1635
1639 public function setCustom(?CustomFields $custom): void
1640 {
1641 $this->custom = $custom;
1642 }
1643
1648 {
1649 $this->discountTypeCombination = $discountTypeCombination;
1650 }
1651
1656 {
1657 $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification;
1658 }
1659
1664 {
1665 $this->lastModifiedBy = $lastModifiedBy;
1666 }
1667
1671 public function setCreatedBy(?CreatedBy $createdBy): void
1672 {
1673 $this->createdBy = $createdBy;
1674 }
1675
1676
1677 #[\ReturnTypeWillChange]
1678 public function jsonSerialize()
1679 {
1680 $data = $this->toArray();
1681 if (isset($data[Cart::FIELD_CREATED_AT]) && $data[Cart::FIELD_CREATED_AT] instanceof \DateTimeImmutable) {
1682 $data[Cart::FIELD_CREATED_AT] = $data[Cart::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c');
1683 }
1684
1685 if (isset($data[Cart::FIELD_LAST_MODIFIED_AT]) && $data[Cart::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) {
1686 $data[Cart::FIELD_LAST_MODIFIED_AT] = $data[Cart::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c');
1687 }
1688 return (object) $data;
1689 }
1690}
setStore(?StoreKeyReference $store)
setLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
__construct(?string $id=null, ?int $version=null, ?DateTimeImmutable $createdAt=null, ?DateTimeImmutable $lastModifiedAt=null, ?string $key=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, ?int $totalLineItemQuantity=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, ?string $cartState=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, ?CustomFields $custom=null, ?DiscountTypeCombination $discountTypeCombination=null, ?int $deleteDaysAfterLastModification=null, ?LastModifiedBy $lastModifiedBy=null, ?CreatedBy $createdBy=null)
setDiscountCodes(?DiscountCodeInfoCollection $discountCodes)
setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification)
setRefusedGifts(?CartDiscountReferenceCollection $refusedGifts)
setBillingAddress(?Address $billingAddress)
setCustomerEmail(?string $customerEmail)
setTaxedShippingPrice(?TaxedPrice $taxedShippingPrice)
setTaxCalculationMode(?string $taxCalculationMode)
setTotalPrice(?CentPrecisionMoney $totalPrice)
setBusinessUnit(?BusinessUnitKeyReference $businessUnit)
setCustomLineItems(?CustomLineItemCollection $customLineItems)
setDiscountTypeCombination(?DiscountTypeCombination $discountTypeCombination)
setCustomerGroup(?CustomerGroupReference $customerGroup)
setShipping(?ShippingCollection $shipping)
setLastModifiedBy(?LastModifiedBy $lastModifiedBy)
setShippingMode(?string $shippingMode)
setTaxedPrice(?TaxedPrice $taxedPrice)
setShippingInfo(?ShippingInfo $shippingInfo)
setPaymentInfo(?PaymentInfo $paymentInfo)
setCreatedAt(?DateTimeImmutable $createdAt)
setShippingRateInput(?ShippingRateInput $shippingRateInput)
setInventoryMode(?string $inventoryMode)
setDiscountOnTotalPrice(?DiscountOnTotalPrice $discountOnTotalPrice)
setTaxRoundingMode(?string $taxRoundingMode)
setShippingAddress(?Address $shippingAddress)
setDirectDiscounts(?DirectDiscountCollection $directDiscounts)
setTotalLineItemQuantity(?int $totalLineItemQuantity)
setLineItems(?LineItemCollection $lineItems)
setShippingCustomFields(?CustomFields $shippingCustomFields)
setItemShippingAddresses(?AddressCollection $itemShippingAddresses)
static fromArray(array $data)