Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getMediaThumbnailSizesRo example
'media_folder_configuration.loaded' =>
[
[
'unserialize', 10
]
,
]
,
]
;
}
public
function
unserialize
(
EntityLoadedEvent
$event
)
: void
{
/** @var MediaFolderConfigurationEntity $media */
foreach
(
$event
->
getEntities
(
)
as
$media
)
{
if
(
$media
->
getMediaThumbnailSizes
(
)
=== null
)
{
if
(
$media
->
getMediaThumbnailSizesRo
(
)
)
{
$media
->
setMediaThumbnailSizes
(
unserialize
(
$media
->
getMediaThumbnailSizesRo
(
)
)
)
;
}
else
{
$media
->
setMediaThumbnailSizes
(
new
MediaThumbnailSizeCollection
(
)
)
;
}
}
}
}
}