You are here

public function RemoveGatherContentLocalData::submitForm in GatherContent 8.4

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 FormInterface::submitForm

File

gathercontent_ui/src/Form/RemoveGatherContentLocalData.php, line 47

Class

RemoveGatherContentLocalData
Class RemoveGatherContentLocalData.

Namespace

Drupal\gathercontent_ui\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $batch = [
    'title' => $this
      ->t('Deleting...'),
    'operations' => [
      [
        static::class . '::deleteAllEntity',
        [
          'gathercontent_operation_item',
        ],
      ],
      [
        static::class . '::deleteAllEntity',
        [
          'gathercontent_operation',
        ],
      ],
      [
        static::class . '::cleanUpGcData',
        [
          'node',
        ],
      ],
      [
        static::class . '::cleanUpGcData',
        [
          'file',
        ],
      ],
    ],
  ];
  batch_set($batch);
  $form_state
    ->setRedirect('system.modules_uninstall');
  drupal_set_message($this
    ->t('Now you can try to uninstall the Gather Content module.'));
}