You are here

public function ContentLinksForm::submitForm in General Data Protection Regulation 8

Same name and namespace in other branches
  1. 8.2 src/Form/ContentLinksForm.php \Drupal\gdpr\Form\ContentLinksForm::submitForm()
  2. 3.0.x src/Form/ContentLinksForm.php \Drupal\gdpr\Form\ContentLinksForm::submitForm()

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

File

src/Form/ContentLinksForm.php, line 130

Class

ContentLinksForm
Class ContentLinksForm.

Namespace

Drupal\gdpr\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->hasValue('links')) {

    /** @var array $links */
    $links = $form_state
      ->getValue('links', []);
    $config = $this->configFactory
      ->getEditable(static::GDPR_CONTENT_CONF_KEY);
    $config
      ->set('links', $links)
      ->save();
  }
  parent::submitForm($form, $form_state);
}