3 declare(strict_types=1);
33 private static $discriminatorClasses = [
34 'absolute' => ProductDiscountValueAbsoluteModel::class,
35 'external' => ProductDiscountValueExternalModel::class,
36 'relative' => ProductDiscountValueRelativeModel::class,
54 if (is_null($this->type)) {
56 $data = $this->
raw(self::FIELD_TYPE);
60 $this->type = (string) $data;
77 if (is_object($value) && isset($value->$fieldName)) {
79 $discriminatorValue = $value->$fieldName;
80 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
81 return self::$discriminatorClasses[$discriminatorValue];
84 if (is_array($value) && isset($value[$fieldName])) {
86 $discriminatorValue = $value[$fieldName];
87 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
88 return self::$discriminatorClasses[$discriminatorValue];
93 $type = ProductDiscountValueModel::class;