3 declare(strict_types=1);
33 private static $discriminatorClasses = [
34 'category' => CategoryImportRequestModel::class,
35 'customer' => CustomerImportRequestModel::class,
36 'discount-code' => DiscountCodeImportRequestModel::class,
37 'inventory' => InventoryImportRequestModel::class,
38 'order' => OrderImportRequestModel::class,
39 'order-patch' => OrderPatchImportRequestModel::class,
40 'price' => PriceImportRequestModel::class,
41 'product' => ProductImportRequestModel::class,
42 'product-draft' => ProductDraftImportRequestModel::class,
43 'product-type' => ProductTypeImportRequestModel::class,
44 'product-variant' => ProductVariantImportRequestModel::class,
45 'product-variant-patch' => ProductVariantPatchRequestModel::class,
46 'standalone-price' => StandalonePriceImportRequestModel::class,
47 'type' => TypeImportRequestModel::class,
67 if (is_null($this->type)) {
69 $data = $this->
raw(self::FIELD_TYPE);
73 $this->type = (string) $data;
90 if (is_object($value) && isset($value->$fieldName)) {
92 $discriminatorValue = $value->$fieldName;
93 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
94 return self::$discriminatorClasses[$discriminatorValue];
97 if (is_array($value) && isset($value[$fieldName])) {
99 $discriminatorValue = $value[$fieldName];
100 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
101 return self::$discriminatorClasses[$discriminatorValue];
106 $type = ImportRequestModel::class;