You are here

public function WebformSubmissionForm::submitForm in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformSubmissionForm.php \Drupal\webform\WebformSubmissionForm::submitForm()

This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state can be updated, this way the subsequently invoked handlers can retrieve a regular entity object to act on. Generally this method should not be overridden unless the entity requires the same preparation for two actions, see \Drupal\comment\CommentForm for an example with the save and preview actions.

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

2 calls to WebformSubmissionForm::submitForm()
WebformSubmissionForm::autosave in src/WebformSubmissionForm.php
Webform submission handler to autosave when there are validation errors.
WebformSubmissionForm::wizardSubmit in src/WebformSubmissionForm.php
Webform submission handler for the wizard submit action.

File

src/WebformSubmissionForm.php, line 1894

Class

WebformSubmissionForm
Provides a webform to collect and edit submissions.

Namespace

Drupal\webform

Code

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

  // Server side #states API submit.
  $this->conditionsValidator
    ->submitForm($form, $form_state);

  // Submit webform via webform handler.
  $this
    ->getWebform()
    ->invokeHandlers('submitForm', $form, $form_state, $this->entity);
}