3 declare(strict_types=1);
34 private static $discriminatorClasses = [
35 'customLineItems' => ChangeTargetCustomLineItemsChangeValueModel::class,
36 'lineItems' => ChangeTargetLineItemsChangeValueModel::class,
37 'multiBuyCustomLineItems' => ChangeTargetMultiBuyCustomLineItemsChangeValueModel::class,
38 'multiBuyLineItems' => ChangeTargetMultiBuyLineItemsChangeValueModel::class,
39 'shipping' => ChangeTargetShippingChangeValueModel::class,
58 if (is_null($this->type)) {
60 $data = $this->
raw(self::FIELD_TYPE);
64 $this->type = (string) $data;
81 if (is_object($value) && isset($value->$fieldName)) {
83 $discriminatorValue = $value->$fieldName;
84 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
85 return self::$discriminatorClasses[$discriminatorValue];
88 if (is_array($value) && isset($value[$fieldName])) {
90 $discriminatorValue = $value[$fieldName];
91 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
92 return self::$discriminatorClasses[$discriminatorValue];
97 $type = ChangeTargetChangeValueModel::class;
static resolveDiscriminatorClass($value)
__construct(?string $type=null)
const DISCRIMINATOR_VALUE
const DISCRIMINATOR_FIELD