Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
findMediaIdsInImageGalleries example
public
static
function
getSubscribedEvents
(
)
: array
{
return
[
UnusedMediaSearchEvent::
class
=>
'removeUsedMedia',
]
;
}
public
function
removeUsedMedia
(
UnusedMediaSearchEvent
$event
)
: void
{
$event
->
markAsUsed
(
$this
->
findMediaIdsInImageGalleries
(
$event
)
)
;
$event
->
markAsUsed
(
$this
->
findMediaIdsInImages
(
$event
)
)
;
foreach
(
[
'category_translation', 'product_translation'
]
as
$table
)
{
$event
->
markAsUsed
(
$this
->
findMediaIdsInImageGalleriesInOverridesTable
(
$table
,
$event
)
)
;
$event
->
markAsUsed
(
$this
->
findMediaIdsInImagesInOverridesTable
(
$table
,
$event
)
)
;
}
}
/** * @return array<string> */