3 declare(strict_types=1);
34 private static $discriminatorClasses = [
35 'absolute' => ChangeValueAbsoluteChangeValueModel::class,
36 'external' => ChangeValueExternalChangeValueModel::class,
37 'giftLineItem' => ChangeValueGiftLineItemChangeValueModel::class,
38 'relative' => ChangeValueRelativeChangeValueModel::class,
57 if (is_null($this->type)) {
59 $data = $this->
raw(self::FIELD_TYPE);
63 $this->type = (string) $data;
80 if (is_object($value) && isset($value->$fieldName)) {
82 $discriminatorValue = $value->$fieldName;
83 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
84 return self::$discriminatorClasses[$discriminatorValue];
87 if (is_array($value) && isset($value[$fieldName])) {
89 $discriminatorValue = $value[$fieldName];
90 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
91 return self::$discriminatorClasses[$discriminatorValue];
96 $type = ChangeValueChangeValueModel::class;
__construct(?string $type=null)
static resolveDiscriminatorClass($value)
const DISCRIMINATOR_VALUE
const DISCRIMINATOR_FIELD