You are here

protected function AuditFilesManagedNotUsedBatchProcess::dispatch in Audit Files 8.3

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

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

Parameters

array $context: Batch context.

File

src/Batch/AuditFilesManagedNotUsedBatchProcess.php, line 61

Class

AuditFilesManagedNotUsedBatchProcess
Batch Worker to handle Deleting entity records from file_managed table.

Namespace

Drupal\auditfiles\Batch

Code

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