public function ServiceAuditFilesManagedNotUsed::auditfilesManagedNotUsedBatchDeleteCreateBatch in Audit Files 8.3
Same name and namespace in other branches
- 8.2 src/ServiceAuditFilesManagedNotUsed.php \Drupal\auditfiles\ServiceAuditFilesManagedNotUsed::auditfilesManagedNotUsedBatchDeleteCreateBatch()
- 4.x src/ServiceAuditFilesManagedNotUsed.php \Drupal\auditfiles\ServiceAuditFilesManagedNotUsed::auditfilesManagedNotUsedBatchDeleteCreateBatch()
Batch process.
File
- src/
ServiceAuditFilesManagedNotUsed.php, line 173
Class
- ServiceAuditFilesManagedNotUsed
- Service managed not used functions.
Namespace
Drupal\auditfilesCode
public function auditfilesManagedNotUsedBatchDeleteCreateBatch(array $fileids) {
$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 files from the file_managed table');
$operations = [];
foreach ($fileids as $file_id) {
if ($file_id != 0) {
$operations[] = [
'\\Drupal\\auditfiles\\Batch\\AuditFilesManagedNotUsedBatchProcess::auditfilesManagedNotUsedBatchDeleteProcessBatch',
[
$file_id,
],
];
}
}
$batch['operations'] = $operations;
return $batch;
}