class AuditFilesBatchProcess in Audit Files 4.x
Same name and namespace in other branches
- 8.3 src/Batch/AuditFilesBatchProcess.php \Drupal\auditfiles\Batch\AuditFilesBatchProcess
Process batch process completion messages.
Hierarchy
- class \Drupal\auditfiles\Batch\AuditFilesBatchProcess
Expanded class hierarchy of AuditFilesBatchProcess
File
- src/
Batch/ AuditFilesBatchProcess.php, line 10
Namespace
Drupal\auditfiles\BatchView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AuditFilesBatchProcess:: |
public static | function | Messenger Factor Service called when the batch is completed. |