$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;
$this->
getBackupResource()->
finishBackup($filterString,
$operations,
$queue->
getInitialSize(),
$timestamp);
} $entityManager->
flush();
$entityManager->
clear();
return [ 'totalCount' =>
$totalCount,
'offset' =>
$offset +
$limit,
'queueId' =>
$queueId,
'done' =>
$done,
];
}