You are here

public function ActionWebformHandler::postSave in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformHandler/ActionWebformHandler.php \Drupal\webform\Plugin\WebformHandler\ActionWebformHandler::postSave()

Acts on a saved webform submission before the insert or update hook is invoked.

Parameters

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

bool $update: TRUE if the entity has been updated, or FALSE if it has been inserted.

Overrides WebformHandlerBase::postSave

File

src/Plugin/WebformHandler/ActionWebformHandler.php, line 275

Class

ActionWebformHandler
Webform submission action handler.

Namespace

Drupal\webform\Plugin\WebformHandler

Code

public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE) {
  $state = $webform_submission
    ->getWebform()
    ->getSetting('results_disabled') ? WebformSubmissionInterface::STATE_COMPLETED : $webform_submission
    ->getState();
  if (in_array($state, $this->configuration['states'])) {
    $this
      ->executeAction($webform_submission);
  }
}