You are here

protected function AuditFilesUsedNotManagedBatchProcess::dispatch in Audit Files 8.3

Same name and namespace in other branches
  1. 4.x src/Batch/AuditFilesUsedNotManagedBatchProcess.php \Drupal\auditfiles\Batch\AuditFilesUsedNotManagedBatchProcess::dispatch()

Processes removal of files from file_managed that are not in file_usage.

Parameters

array $context: Batch context.

File

src/Batch/AuditFilesUsedNotManagedBatchProcess.php, line 61

Class

AuditFilesUsedNotManagedBatchProcess
Batch Worker to remove files from file_usage not in file_managed table.

Namespace

Drupal\auditfiles\Batch

Code

protected function dispatch(array &$context) {
  $this->usedNotManaged
    ->auditfilesUsedNotManagedBatchDeleteProcessFile($this->fileId);
  $context['results'][] = Html::escape($this->fileId);
  $context['message'] = new TranslatableMarkup('Processed file ID %file_id.', [
    '%file_id' => $this->fileId,
  ]);
}