3 declare(strict_types=1);
33 private static $discriminatorClasses = [
34 'addStore' => CartDiscountAddStoreActionModel::class,
35 'changeCartPredicate' => CartDiscountChangeCartPredicateActionModel::class,
36 'changeIsActive' => CartDiscountChangeIsActiveActionModel::class,
37 'changeName' => CartDiscountChangeNameActionModel::class,
38 'changeRequiresDiscountCode' => CartDiscountChangeRequiresDiscountCodeActionModel::class,
39 'changeSortOrder' => CartDiscountChangeSortOrderActionModel::class,
40 'changeStackingMode' => CartDiscountChangeStackingModeActionModel::class,
41 'changeTarget' => CartDiscountChangeTargetActionModel::class,
42 'changeValue' => CartDiscountChangeValueActionModel::class,
43 'removeStore' => CartDiscountRemoveStoreActionModel::class,
44 'setCustomField' => CartDiscountSetCustomFieldActionModel::class,
45 'setCustomType' => CartDiscountSetCustomTypeActionModel::class,
46 'setDescription' => CartDiscountSetDescriptionActionModel::class,
47 'setKey' => CartDiscountSetKeyActionModel::class,
48 'setStores' => CartDiscountSetStoresActionModel::class,
49 'setValidFrom' => CartDiscountSetValidFromActionModel::class,
50 'setValidFromAndUntil' => CartDiscountSetValidFromAndUntilActionModel::class,
51 'setValidUntil' => CartDiscountSetValidUntilActionModel::class,
69 if (is_null($this->action)) {
71 $data = $this->
raw(self::FIELD_ACTION);
75 $this->action = (string) $data;
92 if (is_object($value) && isset($value->$fieldName)) {
94 $discriminatorValue = $value->$fieldName;
95 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
96 return self::$discriminatorClasses[$discriminatorValue];
99 if (is_array($value) && isset($value[$fieldName])) {
101 $discriminatorValue = $value[$fieldName];
102 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
103 return self::$discriminatorClasses[$discriminatorValue];
108 $type = CartDiscountUpdateActionModel::class;