3 declare(strict_types=1);
33 private static $discriminatorClasses = [
34 'changeCartDiscounts' => DiscountCodeChangeCartDiscountsActionModel::class,
35 'changeGroups' => DiscountCodeChangeGroupsActionModel::class,
36 'changeIsActive' => DiscountCodeChangeIsActiveActionModel::class,
37 'setCartPredicate' => DiscountCodeSetCartPredicateActionModel::class,
38 'setCustomField' => DiscountCodeSetCustomFieldActionModel::class,
39 'setCustomType' => DiscountCodeSetCustomTypeActionModel::class,
40 'setDescription' => DiscountCodeSetDescriptionActionModel::class,
41 'setKey' => DiscountCodeSetKeyActionModel::class,
42 'setMaxApplications' => DiscountCodeSetMaxApplicationsActionModel::class,
43 'setMaxApplicationsPerCustomer' => DiscountCodeSetMaxApplicationsPerCustomerActionModel::class,
44 'setName' => DiscountCodeSetNameActionModel::class,
45 'setValidFrom' => DiscountCodeSetValidFromActionModel::class,
46 'setValidFromAndUntil' => DiscountCodeSetValidFromAndUntilActionModel::class,
47 'setValidUntil' => DiscountCodeSetValidUntilActionModel::class,
65 if (is_null($this->action)) {
67 $data = $this->
raw(self::FIELD_ACTION);
71 $this->action = (string) $data;
88 if (is_object($value) && isset($value->$fieldName)) {
90 $discriminatorValue = $value->$fieldName;
91 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
92 return self::$discriminatorClasses[$discriminatorValue];
95 if (is_array($value) && isset($value[$fieldName])) {
97 $discriminatorValue = $value[$fieldName];
98 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
99 return self::$discriminatorClasses[$discriminatorValue];
104 $type = DiscountCodeUpdateActionModel::class;