You are here

public function CivicrmWebformHandler::preSave in Webform CiviCRM Integration 8.5

Acts on a webform submission before the presave hook is invoked.

Parameters

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

Overrides WebformHandlerBase::preSave

File

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

Class

CivicrmWebformHandler
CiviCRM Webform Handler plugin.

Namespace

Drupal\webform_civicrm\Plugin\WebformHandler

Code

public function preSave(WebformSubmissionInterface $webform_submission) {
  $this->civicrm
    ->initialize();
  $processor = \Drupal::service('webform_civicrm.postprocess')
    ->initialize($webform_submission
    ->getWebform());
  $processor
    ->preSave($webform_submission);
}