$criteria =
new Criteria([$mediaConfig->
getStringValue()]);
$criteriaCollection =
new CriteriaCollection();
$criteriaCollection->
add('media_' .
$slot->
getUniqueIdentifier(), MediaDefinition::
class,
$criteria);
return $criteriaCollection;
} public function enrich(CmsSlotEntity
$slot, ResolverContext
$resolverContext, ElementDataCollection
$result): void
{ $config =
$slot->
getFieldConfig();
$image =
new ImageStruct();
$slot->
setData($image);
$mediaConfig =
$config->
get('previewMedia'
);
if ($mediaConfig &&
$mediaConfig->
getValue()) { $this->
addMediaEntity($slot,
$image,
$result,
$mediaConfig,
$resolverContext);
} } private function addMediaEntity(CmsSlotEntity
$slot, ImageStruct
$image, ElementDataCollection
$result, FieldConfig
$config, ResolverContext
$resolverContext): void
{ if ($config->
isMapped() &&
$resolverContext instanceof EntityResolverContext
) {