CodeExplorer ManufacturerLogoStruct example
$criteria =
new Criteria([$mediaConfig->
getStringValue()]);
$criteriaCollection = parent::
collect($slot,
$resolverContext) ??
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();
$manufacturerStruct =
new ManufacturerLogoStruct();
$slot->
setData($manufacturerStruct);
$urlConfig =
$config->
get('url'
);
if ($urlConfig !== null
) { $manufacturerStruct->
setUrl($this->
getConfigUrl($urlConfig,
$resolverContext));
} $newTabConfig =
$config->
get('newTab'
);
if ($newTabConfig !== null
) { $manufacturerStruct->
setNewTab($newTabConfig->
getBoolValue());
}