3 declare(strict_types=1);
34 private static $discriminatorClasses = [
35 'AssociateRoleLabel' => AssociateRoleLabelModel::class,
36 'BusinessUnitLabel' => BusinessUnitLabelModel::class,
37 'CustomObjectLabel' => CustomObjectLabelModel::class,
38 'CustomerLabel' => CustomerLabelModel::class,
39 'LocalizedLabel' => LocalizedLabelModel::class,
40 'OrderLabel' => OrderLabelModel::class,
41 'PaymentLabel' => PaymentLabelModel::class,
42 'ProductLabel' => ProductLabelModel::class,
43 'QuoteLabel' => QuoteLabelModel::class,
44 'QuoteRequestLabel' => QuoteRequestLabelModel::class,
45 'ReviewLabel' => ReviewLabelModel::class,
46 'StagedQuoteLabel' => StagedQuoteLabelModel::class,
47 'StringLabel' => StringLabelModel::class,
66 if (is_null($this->type)) {
68 $data = $this->
raw(self::FIELD_TYPE);
72 $this->type = (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 = LabelModel::class;
const DISCRIMINATOR_VALUE
__construct(?string $type=null)
static resolveDiscriminatorClass($value)
const DISCRIMINATOR_FIELD