3 declare(strict_types=1);
33 private static $discriminatorClasses = [
34 'addCustomLineItem' => CartAddCustomLineItemActionModel::class,
35 'addCustomShippingMethod' => CartAddCustomShippingMethodActionModel::class,
36 'addDiscountCode' => CartAddDiscountCodeActionModel::class,
37 'addItemShippingAddress' => CartAddItemShippingAddressActionModel::class,
38 'addLineItem' => CartAddLineItemActionModel::class,
39 'addPayment' => CartAddPaymentActionModel::class,
40 'addShippingMethod' => CartAddShippingMethodActionModel::class,
41 'addShoppingList' => CartAddShoppingListActionModel::class,
42 'applyDeltaToCustomLineItemShippingDetailsTargets' => CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel::class,
43 'applyDeltaToLineItemShippingDetailsTargets' => CartApplyDeltaToLineItemShippingDetailsTargetsActionModel::class,
44 'changeCustomLineItemMoney' => CartChangeCustomLineItemMoneyActionModel::class,
45 'changeCustomLineItemPriceMode' => CartChangeCustomLineItemPriceModeActionModel::class,
46 'changeCustomLineItemQuantity' => CartChangeCustomLineItemQuantityActionModel::class,
47 'changeLineItemQuantity' => CartChangeLineItemQuantityActionModel::class,
48 'changeLineItemsOrder' => CartChangeLineItemsOrderActionModel::class,
49 'changeTaxCalculationMode' => CartChangeTaxCalculationModeActionModel::class,
50 'changeTaxMode' => CartChangeTaxModeActionModel::class,
51 'changeTaxRoundingMode' => CartChangeTaxRoundingModeActionModel::class,
52 'freezeCart' => CartFreezeCartActionModel::class,
53 'recalculate' => CartRecalculateActionModel::class,
54 'removeCustomLineItem' => CartRemoveCustomLineItemActionModel::class,
55 'removeDiscountCode' => CartRemoveDiscountCodeActionModel::class,
56 'removeItemShippingAddress' => CartRemoveItemShippingAddressActionModel::class,
57 'removeLineItem' => CartRemoveLineItemActionModel::class,
58 'removePayment' => CartRemovePaymentActionModel::class,
59 'removeShippingMethod' => CartRemoveShippingMethodActionModel::class,
60 'setAnonymousId' => CartSetAnonymousIdActionModel::class,
61 'setBillingAddress' => CartSetBillingAddressActionModel::class,
62 'setBillingAddressCustomField' => CartSetBillingAddressCustomFieldActionModel::class,
63 'setBillingAddressCustomType' => CartSetBillingAddressCustomTypeActionModel::class,
64 'setBusinessUnit' => CartSetBusinessUnitActionModel::class,
65 'setCartTotalTax' => CartSetCartTotalTaxActionModel::class,
66 'setCountry' => CartSetCountryActionModel::class,
67 'setCustomField' => CartSetCustomFieldActionModel::class,
68 'setCustomLineItemCustomField' => CartSetCustomLineItemCustomFieldActionModel::class,
69 'setCustomLineItemCustomType' => CartSetCustomLineItemCustomTypeActionModel::class,
70 'setCustomLineItemShippingDetails' => CartSetCustomLineItemShippingDetailsActionModel::class,
71 'setCustomLineItemTaxAmount' => CartSetCustomLineItemTaxAmountActionModel::class,
72 'setCustomLineItemTaxRate' => CartSetCustomLineItemTaxRateActionModel::class,
73 'setCustomShippingMethod' => CartSetCustomShippingMethodActionModel::class,
74 'setCustomType' => CartSetCustomTypeActionModel::class,
75 'setCustomerEmail' => CartSetCustomerEmailActionModel::class,
76 'setCustomerGroup' => CartSetCustomerGroupActionModel::class,
77 'setCustomerId' => CartSetCustomerIdActionModel::class,
78 'setDeleteDaysAfterLastModification' => CartSetDeleteDaysAfterLastModificationActionModel::class,
79 'setDirectDiscounts' => CartSetDirectDiscountsActionModel::class,
80 'setItemShippingAddressCustomField' => CartSetItemShippingAddressCustomFieldActionModel::class,
81 'setItemShippingAddressCustomType' => CartSetItemShippingAddressCustomTypeActionModel::class,
82 'setKey' => CartSetKeyActionModel::class,
83 'setLineItemCustomField' => CartSetLineItemCustomFieldActionModel::class,
84 'setLineItemCustomType' => CartSetLineItemCustomTypeActionModel::class,
85 'setLineItemDistributionChannel' => CartSetLineItemDistributionChannelActionModel::class,
86 'setLineItemInventoryMode' => CartSetLineItemInventoryModeActionModel::class,
87 'setLineItemPrice' => CartSetLineItemPriceActionModel::class,
88 'setLineItemShippingDetails' => CartSetLineItemShippingDetailsActionModel::class,
89 'setLineItemSupplyChannel' => CartSetLineItemSupplyChannelActionModel::class,
90 'setLineItemTaxAmount' => CartSetLineItemTaxAmountActionModel::class,
91 'setLineItemTaxRate' => CartSetLineItemTaxRateActionModel::class,
92 'setLineItemTotalPrice' => CartSetLineItemTotalPriceActionModel::class,
93 'setLocale' => CartSetLocaleActionModel::class,
94 'setShippingAddress' => CartSetShippingAddressActionModel::class,
95 'setShippingAddressCustomField' => CartSetShippingAddressCustomFieldActionModel::class,
96 'setShippingAddressCustomType' => CartSetShippingAddressCustomTypeActionModel::class,
97 'setShippingCustomField' => CartSetShippingCustomFieldActionModel::class,
98 'setShippingCustomType' => CartSetShippingCustomTypeActionModel::class,
99 'setShippingMethod' => CartSetShippingMethodActionModel::class,
100 'setShippingMethodTaxAmount' => CartSetShippingMethodTaxAmountActionModel::class,
101 'setShippingMethodTaxRate' => CartSetShippingMethodTaxRateActionModel::class,
102 'setShippingRateInput' => CartSetShippingRateInputActionModel::class,
103 'unfreezeCart' => CartUnfreezeCartActionModel::class,
104 'updateItemShippingAddress' => CartUpdateItemShippingAddressActionModel::class,
122 if (is_null($this->action)) {
124 $data = $this->
raw(self::FIELD_ACTION);
125 if (is_null($data)) {
128 $this->action = (string) $data;
145 if (is_object($value) && isset($value->$fieldName)) {
147 $discriminatorValue = $value->$fieldName;
148 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
149 return self::$discriminatorClasses[$discriminatorValue];
152 if (is_array($value) && isset($value[$fieldName])) {
154 $discriminatorValue = $value[$fieldName];
155 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
156 return self::$discriminatorClasses[$discriminatorValue];
161 $type = CartUpdateActionModel::class;