public function EntityReferenceRevisionsOrphanPurger::doBatchSubmitFinished in Entity Reference Revisions 8
Finished callback for the batch process.
Parameters
bool $success: Whether the batch completed successfully.
array $results: The results array.
array $operations: The operations array.
File
- src/
EntityReferenceRevisionsOrphanPurger.php, line 275
Class
- EntityReferenceRevisionsOrphanPurger
- Manages orphan composite revision deletion.
Namespace
Drupal\entity_reference_revisionsCode
public function doBatchSubmitFinished($success, $results, $operations) {
if ($success) {
foreach ($results as $entity_type_id => $result) {
if ($this->entityTypeManager
->hasDefinition($entity_type_id)) {
$entity_type = $this->entityTypeManager
->getDefinition($entity_type_id);
$interval = $this->dateFormatter
->formatInterval($result['end'] - $result['start']);
$this->messenger
->addMessage($this
->t('@label: Deleted @revision_count revisions (@entity_count entities) in @interval.', [
'@label' => $entity_type
->getLabel(),
'@revision_count' => $result['revision_count'],
'@entity_count' => $result['entity_count'],
'@interval' => $interval,
]));
}
}
}
else {
// $operations contains the operations that remained unprocessed.
$error_operation = reset($operations);
$this->messenger
->addError($this
->t('An error occurred while processing @operation with arguments : @args', [
'@operation' => $error_operation[0],
'@args' => print_r($error_operation[0], TRUE),
]));
}
}