/**
* @param array{url?: string, newTab?: bool, mediaId: string} $config
*/
private function addMedia(CmsSlotEntity
$slot, ImageSliderStruct
$imageSlider, ElementDataCollection
$result, array
$config): void
{ $imageSliderItem =
new ImageSliderItemStruct();
if (!
empty($config['url'
])) { $imageSliderItem->
setUrl($config['url'
]);
$imageSliderItem->
setNewTab($config['newTab'
] ?? false
);
} $searchResult =
$result->
get('media_' .
$slot->
getUniqueIdentifier());
if (!
$searchResult) { return;
} /** @var MediaEntity|null $media */
$media =
$searchResult->
get($config['mediaId'
]);
if (!
$media) { return;
}