public function ServiceAuditFilesReferencedNotUsed::auditfilesReferencedNotUsedBatchDeleteCreateBatch in Audit Files 8.3
Same name and namespace in other branches
- 8.2 src/ServiceAuditFilesReferencedNotUsed.php \Drupal\auditfiles\ServiceAuditFilesReferencedNotUsed::auditfilesReferencedNotUsedBatchDeleteCreateBatch()
- 4.x src/ServiceAuditFilesReferencedNotUsed.php \Drupal\auditfiles\ServiceAuditFilesReferencedNotUsed::auditfilesReferencedNotUsedBatchDeleteCreateBatch()
Creates the batch for deleting file references from their content.
Parameters
array $referenceids: The list of IDs to be processed.
Return value
array The definition of the batch.
File
- src/
ServiceAuditFilesReferencedNotUsed.php, line 296
Class
- ServiceAuditFilesReferencedNotUsed
- List all methods used in referenced not used functionality.
Namespace
Drupal\auditfilesCode
public function auditfilesReferencedNotUsedBatchDeleteCreateBatch(array $referenceids) {
$batch['error_message'] = $this->stringTranslation
->translate('One or more errors were encountered processing the files.');
$batch['finished'] = '\\Drupal\\auditfiles\\Batch\\AuditFilesBatchProcess::finishBatch';
$batch['progress_message'] = $this->stringTranslation
->translate('Completed @current of @total operations.');
$batch['title'] = $this->stringTranslation
->translate('Deleting file references from their content');
$operations = [];
foreach ($referenceids as $reference_id) {
if ($reference_id != '') {
$operations[] = [
'\\Drupal\\auditfiles\\Batch\\AuditFilesReferencedNotUsedBatchProcess::auditfilesReferencedNotUsedBatchDeleteProcessBatch',
[
$reference_id,
],
];
}
}
$batch['operations'] = $operations;
return $batch;
}