You are here

public function PrepareHttpblEntityUninstallForm::submitForm in http:BL 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides PrepareModulesEntityUninstallForm::submitForm

File

src/Form/PrepareHttpblEntityUninstallForm.php, line 102

Class

PrepareHttpblEntityUninstallForm
Provides a form removing httpbl content entities data before uninstallation.

Namespace

Drupal\httpbl\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $entity_type_id = $form_state
    ->getValue('entity_type_id');
  $entity_type_plural = $this->entityTypeManager
    ->getDefinition($entity_type_id)
    ->getPluralLabel();
  $batch = [
    'title' => t('Deleting @entity_type_plural', [
      '@entity_type_plural' => $entity_type_plural,
    ]),
    'operations' => [
      [
        [
          __CLASS__,
          'deleteContentEntities',
        ],
        [
          $entity_type_id,
        ],
      ],
    ],
    'finished' => [
      __CLASS__,
      'moduleBatchFinished',
    ],
    'progress_message' => '',
  ];
  batch_set($batch);
}