Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createMediaThumbnails example
$query
=
$repository
->
getAlbumMediaQuery
(
$album
->
getId
(
)
)
;
$paginator
=
$em
->
createPaginator
(
$query
)
;
$total
=
$paginator
->
count
(
)
;
$progressBar
=
new
ProgressBar
(
$this
->output,
$total
)
;
$progressBar
->
setRedrawFrequency
(
10
)
;
$progressBar
->
start
(
)
;
foreach
(
$paginator
as
$media
)
{
try
{
$this
->
createMediaThumbnails
(
$media
)
;
}
catch
(
Exception
$e
)
{
$this
->errors
[
]
=
$e
->
getMessage
(
)
;
}
$progressBar
->
advance
(
)
;
}
$progressBar
->
finish
(
)
;
// Force newline when processing the next album
$this
->output->
writeln
(
''
)
;
}