CodeExplorer getRetinaSource example
public function convertMediaStruct(?Media
$media = null
) { 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(),