You are here

public function WebformEntitySettingsBaseForm::save in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/EntitySettings/WebformEntitySettingsBaseForm.php \Drupal\webform\EntitySettings\WebformEntitySettingsBaseForm::save()

Form submission handler for the 'save' action.

Normally this method should be overridden to provide specific messages to the user and redirect the form after the entity has been saved.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

int Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.

Overrides EntityForm::save

6 calls to WebformEntitySettingsBaseForm::save()
WebformEntitySettingsAccessForm::save in src/EntitySettings/WebformEntitySettingsAccessForm.php
Form submission handler for the 'save' action.
WebformEntitySettingsAssetsForm::save in src/EntitySettings/WebformEntitySettingsAssetsForm.php
Form submission handler for the 'save' action.
WebformEntitySettingsConfirmationForm::save in src/EntitySettings/WebformEntitySettingsConfirmationForm.php
Form submission handler for the 'save' action.
WebformEntitySettingsFormForm::save in src/EntitySettings/WebformEntitySettingsFormForm.php
Form submission handler for the 'save' action.
WebformEntitySettingsGeneralForm::save in src/EntitySettings/WebformEntitySettingsGeneralForm.php
Form submission handler for the 'save' action.

... See full list

6 methods override WebformEntitySettingsBaseForm::save()
WebformEntitySettingsAccessForm::save in src/EntitySettings/WebformEntitySettingsAccessForm.php
Form submission handler for the 'save' action.
WebformEntitySettingsAssetsForm::save in src/EntitySettings/WebformEntitySettingsAssetsForm.php
Form submission handler for the 'save' action.
WebformEntitySettingsConfirmationForm::save in src/EntitySettings/WebformEntitySettingsConfirmationForm.php
Form submission handler for the 'save' action.
WebformEntitySettingsFormForm::save in src/EntitySettings/WebformEntitySettingsFormForm.php
Form submission handler for the 'save' action.
WebformEntitySettingsGeneralForm::save in src/EntitySettings/WebformEntitySettingsGeneralForm.php
Form submission handler for the 'save' action.

... See full list

File

src/EntitySettings/WebformEntitySettingsBaseForm.php, line 49

Class

WebformEntitySettingsBaseForm
Base webform entity settings form.

Namespace

Drupal\webform\EntitySettings

Code

public function save(array $form, FormStateInterface $form_state) {
  parent::save($form, $form_state);

  /** @var \Drupal\webform\WebformInterface $webform */
  $webform = $this
    ->getEntity();
  $context = [
    '@label' => $webform
      ->label(),
    'link' => $webform
      ->toLink($this
      ->t('Edit'), 'settings')
      ->toString(),
  ];
  $this
    ->logger('webform')
    ->notice('Webform settings @label has been saved.', $context);
  $this
    ->messenger()
    ->addStatus($this
    ->t('Webform settings %label has been saved.', [
    '%label' => $webform
      ->label(),
  ]));
}