if (($i++ % 20
) === 0
) { $entityManager->
flush($model);
$entityManager->
clear();
/** @var QueueModel $queue */
$queue =
$entityManager->
getReference(QueueModel::
class,
$queueId);
} /** @var Detail $detail */
$detail =
$entityManager->
getReference(\Shopware\Models\Article\Detail::
class,
$detailId);
$model =
new QueueArticle();
$model->
setQueue($queue);
$model->
setDetail($detail);
$entityManager->
persist($model);
} $done =
($offset +
$limit) >=
$totalCount;
// When done, set the queue to active and finish the backup
if ($done) { $queue->
setActive(true
);
$timestamp =
$queue->
getCreated() ?
$queue->
getCreated()->
getTimestamp() : null;