CodeExplorer getSourceSet example
if (!
$media instanceof Media
) { return [];
} $thumbnails =
[];
foreach ($media->
getThumbnails() as $thumbnail) { $thumbnails[] =
[ 'source' =>
$thumbnail->
getSource(),
'retinaSource' =>
$thumbnail->
getRetinaSource(),
'sourceSet' =>
$this->
getSourceSet($thumbnail),
'maxWidth' =>
$thumbnail->
getMaxWidth(),
'maxHeight' =>
$thumbnail->
getMaxHeight(),
'attributes' =>
$thumbnail->
getAttributes(),
];
} $data =
[ 'id' =>
$media->
getId(),
'position' => null,
'source' =>
$media->
getFile(),
'description' =>
$media->
getName(),