You are here

public function CivicrmWebformHandler::validateForm in Webform CiviCRM Integration 8.5

Validate webform submission form.

Parameters

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

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

\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.

Overrides WebformHandlerBase::validateForm

File

src/Plugin/WebformHandler/CivicrmWebformHandler.php, line 127

Class

CivicrmWebformHandler
CiviCRM Webform Handler plugin.

Namespace

Drupal\webform_civicrm\Plugin\WebformHandler

Code

public function validateForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) {
  $this->civicrm
    ->initialize();
  $processor = \Drupal::service('webform_civicrm.postprocess')
    ->initialize($webform_submission
    ->getWebform());
  $processor
    ->validate($form, $form_state, $webform_submission);
}