You are here

class AuditFilesBatchProcess in Audit Files 4.x

Same name and namespace in other branches
  1. 8.3 src/Batch/AuditFilesBatchProcess.php \Drupal\auditfiles\Batch\AuditFilesBatchProcess

Process batch process completion messages.

Hierarchy

Expanded class hierarchy of AuditFilesBatchProcess

File

src/Batch/AuditFilesBatchProcess.php, line 10

Namespace

Drupal\auditfiles\Batch
View source
class AuditFilesBatchProcess {

  /**
   * Messenger Factor Service called when the batch is completed.
   *
   * @todo Refactor into a factory worker process class.
   */
  public static function finishBatch($success, $results, $operations) {
    $messenger = \Drupal::service('messenger');
    if (!$success) {
      $error_operation = reset($operations);
      $messenger
        ->addError(new TranslatableMarkup('An error occurred while processing @operation with arguments : @args', [
        '@operation' => $error_operation[0],
        '@args' => print_r($error_operation[0], TRUE),
      ]));
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AuditFilesBatchProcess::finishBatch public static function Messenger Factor Service called when the batch is completed.