You are here

public function EntityUpdateTestSettings::submitForm in Entity Update 2.0.x

Same name and namespace in other branches
  1. 8 modules/entity_update_tests/src/Form/EntityUpdateTestSettings.php \Drupal\entity_update_tests\Form\EntityUpdateTestSettings::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 FormInterface::submitForm

File

tests/modules/entity_update_tests/src/Form/EntityUpdateTestSettings.php, line 74

Class

EntityUpdateTestSettings
Class CheckEntityUpdate.

Namespace

Drupal\entity_update_tests\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $fields = self::getConfigurableFields();
  foreach ($fields as $field_key => $field_name) {
    $value = $form_state
      ->getValue($field_key);
    $this
      ->messenger()
      ->addMessage("{$field_name} : ({$value}) " . ($value ? "TRUE" : "FALSE"));
    EntityUpdateTestHelper::fieldEnable($field_key, $value);
  }
  $this
    ->messenger()
    ->addMessage($this
    ->t("Test entity configuration success"));
}