public function decode(Field
$field, mixed
$value): ?VariantListingConfig
{ if ($value === null
) { return null;
} if (\
is_string($value)) { $value =
json_decode($value, true, 512, \JSON_THROW_ON_ERROR
);
} return new VariantListingConfig( isset($value['displayParent'
]) ?
(bool) $value['displayParent'
] : null,
$value['mainVariantId'
] ?? null,
$value['configuratorGroupConfig'
] ?? null,
);
} protected function getConstraints(Field
$field): array
{ return [ new Collection([ 'allowExtraFields' => true,