You are here

public function BehaviorForm::submitForm in Synonyms 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 ConfigFormBase::submitForm

File

src/Form/BehaviorForm.php, line 201

Class

BehaviorForm
The behavior form for given entity type.

Namespace

Drupal\synonyms\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  foreach ($this->behaviorService
    ->getBehaviorServices() as $service_id => $service) {
    $this
      ->setNames($service_id);
    $this
      ->config($this
      ->getConfigName($service_id))
      ->set('status', $form_state
      ->getValue($this->statusName))
      ->set('wording', $form_state
      ->getValue($this->wordingName))
      ->save();
    parent::submitForm($form, $form_state);
  }
}