Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
generateAsynchronous example
$this
->io =
new
ShopwareStyle
(
$input
,
$output
)
;
$context
= Context::
createDefaultContext
(
)
;
$this
->
initializeCommand
(
$input
,
$context
)
;
/** @var RepositoryIterator<MediaCollection> $mediaIterator */
$mediaIterator
=
new
RepositoryIterator
(
$this
->mediaRepository,
$context
,
$this
->
createCriteria
(
)
)
;
if
(
!
$this
->isAsync
)
{
$this
->
generateSynchronous
(
$mediaIterator
,
$context
)
;
}
else
{
$this
->
generateAsynchronous
(
$mediaIterator
,
$context
)
;
}
return
self::SUCCESS;
}
private
function
initializeCommand
(
InputInterface
$input
, Context
$context
)
: void
{
$this
->folderFilter =
$this
->
getFolderFilterFromInput
(
$input
,
$context
)
;
$this
->batchSize =
$this
->
getBatchSizeFromInput
(
$input
)
;
$this
->isAsync =
$input
->
getOption
(
'async'
)
;
$this
->isStrict =
$input
->
getOption
(
'strict'
)
;
}