You are here

public static function WebformSubmissionForm::submitFormValues in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformSubmissionForm.php \Drupal\webform\WebformSubmissionForm::submitFormValues()

Programmatically validate form values and submit a webform submission.

Parameters

array $values: An array of submission form values and data.

bool $validate_only: Flag to trigger only webform validation. Defaults to FALSE.

Return value

array|\Drupal\webform\WebformSubmissionInterface|null An array of error messages if validation fails or a webform submission (when $validate_only is FALSE) or NULL (when $validate_only is TRUE) if there are no validation errors.

4 calls to WebformSubmissionForm::submitFormValues()
WebformDevelSubmissionApiForm::submitForm in modules/webform_devel/src/Form/WebformDevelSubmissionApiForm.php
Form submission handler.
WebformSettingsRemoteAddrTest::testRemoteAddr in tests/src/Functional/Settings/WebformSettingsRemoteAddrTest.php
Tests webform disable remote IP address.
WebformSubmissionApiTest::testApi in tests/src/Functional/WebformSubmissionApiTest.php
Test webform API.
WebformSubmissionForm::validateFormValues in src/WebformSubmissionForm.php
Programmatically validate form values and submit a webform submission.

File

src/WebformSubmissionForm.php, line 3165

Class

WebformSubmissionForm
Provides a webform to collect and edit submissions.

Namespace

Drupal\webform

Code

public static function submitFormValues(array $values, $validate_only = FALSE) {
  $webform_submission = WebformSubmission::create($values);
  return static::submitWebformSubmission($webform_submission, $validate_only);
}