Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getMediaTypeRaw example
foreach
(
$media
->
getThumbnails
(
)
??
[
]
as
$thumbnail
)
{
$this
->
addThumbnailUrl
(
$thumbnail
,
$media
)
;
}
}
}
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
(
)
)
;
}
}
}
}