You are here

public function ConfigSplitDeactivateForm::submitForm in Configuration Split 2.0.x

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

src/Form/ConfigSplitDeactivateForm.php, line 126

Class

ConfigSplitDeactivateForm
The form for de-activating a split.

Namespace

Drupal\config_split\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $split = $this
    ->getSplit();
  $override = FALSE;
  if ($form_state
    ->getValue('deactivate_local_only')) {
    $this->statusOverride
      ->setSplitOverride($split
      ->getName(), FALSE);
    $override = TRUE;
  }
  else {
    $this->statusOverride
      ->setSplitOverride($split
      ->getName(), NULL);
  }
  $comparer = new StorageComparer($this->manager
    ->singleDeactivate($split, $form_state
    ->getValue('export_before'), $override), $this->activeStorage);
  $this
    ->launchImport($comparer);
}