3 declare(strict_types=1);
33 private static $discriminatorClasses = [
34 'addShippingRate' => ShippingMethodAddShippingRateActionModel::class,
35 'addZone' => ShippingMethodAddZoneActionModel::class,
36 'changeActive' => ShippingMethodChangeActiveActionModel::class,
37 'changeIsDefault' => ShippingMethodChangeIsDefaultActionModel::class,
38 'changeName' => ShippingMethodChangeNameActionModel::class,
39 'changeTaxCategory' => ShippingMethodChangeTaxCategoryActionModel::class,
40 'removeShippingRate' => ShippingMethodRemoveShippingRateActionModel::class,
41 'removeZone' => ShippingMethodRemoveZoneActionModel::class,
42 'setCustomField' => ShippingMethodSetCustomFieldActionModel::class,
43 'setCustomType' => ShippingMethodSetCustomTypeActionModel::class,
44 'setDescription' => ShippingMethodSetDescriptionActionModel::class,
45 'setKey' => ShippingMethodSetKeyActionModel::class,
46 'setLocalizedDescription' => ShippingMethodSetLocalizedDescriptionActionModel::class,
47 'setLocalizedName' => ShippingMethodSetLocalizedNameActionModel::class,
48 'setPredicate' => ShippingMethodSetPredicateActionModel::class,
66 if (is_null($this->action)) {
68 $data = $this->
raw(self::FIELD_ACTION);
72 $this->action = (string) $data;
89 if (is_object($value) && isset($value->$fieldName)) {
91 $discriminatorValue = $value->$fieldName;
92 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
93 return self::$discriminatorClasses[$discriminatorValue];
96 if (is_array($value) && isset($value[$fieldName])) {
98 $discriminatorValue = $value[$fieldName];
99 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
100 return self::$discriminatorClasses[$discriminatorValue];
105 $type = ShippingMethodUpdateActionModel::class;