Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getThumbnailsRo example
public
function
unserialize
(
EntityLoadedEvent
$event
)
: void
{
/** @var MediaEntity $media */
foreach
(
$event
->
getEntities
(
)
as
$media
)
{
if
(
$media
->
getMediaTypeRaw
(
)
)
{
$media
->
setMediaType
(
unserialize
(
$media
->
getMediaTypeRaw
(
)
)
)
;
}
if
(
$media
->
getThumbnails
(
)
=== null
)
{
if
(
$media
->
getThumbnailsRo
(
)
)
{
$media
->
setThumbnails
(
unserialize
(
$media
->
getThumbnailsRo
(
)
)
)
;
}
else
{
$media
->
setThumbnails
(
new
MediaThumbnailCollection
(
)
)
;
}
}
}
}
private
function
addThumbnailUrl
(
MediaThumbnailEntity
$thumbnail
, MediaEntity
$media
)
: void
{
$thumbnail
->
setUrl
(