You are here

public function EnvironmentIndicatorForm::save in Environment Indicator 4.x

Same name and namespace in other branches
  1. 8.3 src/EnvironmentIndicatorForm.php \Drupal\environment_indicator\EnvironmentIndicatorForm::save()

Save your config entity.

There will eventually be default code to rely on here, but it doesn't exist yet.

Overrides EntityForm::save

File

src/EnvironmentIndicatorForm.php, line 62

Class

EnvironmentIndicatorForm
Form field specifications.

Namespace

Drupal\environment_indicator

Code

public function save(array $form, FormStateInterface $form_state) {
  $environment = $this
    ->getEntity();
  $environment
    ->save();
  $this
    ->messenger()
    ->addMessage($this
    ->t('Saved the %label environment.', [
    '%label' => $environment
      ->label(),
  ]));
  $form_state
    ->setRedirect('entity.environment_indicator.collection');
}