Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
isStrict example
$criteria
=
new
Criteria
(
)
;
$criteria
->
addAssociation
(
'mediaFolder.configuration.mediaThumbnailSizes'
)
;
$criteria
->
addFilter
(
new
EqualsAnyFilter
(
'media.id',
$msg
->
getMediaIds
(
)
)
)
;
/** @var MediaCollection $entities */
$entities
=
$this
->mediaRepository->
search
(
$criteria
,
$context
)
->
getEntities
(
)
;
if
(
$msg
instanceof UpdateThumbnailsMessage
)
{
foreach
(
$entities
as
$media
)
{
$this
->thumbnailService->
updateThumbnails
(
$media
,
$context
,
$msg
->
isStrict
(
)
)
;
}
}
else
{
$this
->thumbnailService->
generate
(
$entities
,
$context
)
;
}
}
}