You are here

public static function PrepareModulesEntityUninstallForm::moduleBatchFinished in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/src/Form/PrepareModulesEntityUninstallForm.php \Drupal\system\Form\PrepareModulesEntityUninstallForm::moduleBatchFinished()

Implements callback_batch_finished().

Finishes the module batch, redirect to the uninstall page and output the successful data deletion message.

File

core/modules/system/src/Form/PrepareModulesEntityUninstallForm.php, line 251

Class

PrepareModulesEntityUninstallForm
Provides a form removing module content entities data before uninstallation.

Namespace

Drupal\system\Form

Code

public static function moduleBatchFinished($success, $results, $operations) {
  $entity_type_plural = \Drupal::entityTypeManager()
    ->getDefinition($results['entity_type_id'])
    ->getPluralLabel();
  \Drupal::messenger()
    ->addStatus(t('All @entity_type_plural have been deleted.', [
    '@entity_type_plural' => $entity_type_plural,
  ]));
  return new RedirectResponse(Url::fromRoute('system.modules_uninstall')
    ->setAbsolute()
    ->toString());
}