You are here

public function WebformMessageManager::setWebformSubmission in Webform 8.5

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

Set the webform submission used for token replacement.

Webform and source entity will also be set using the webform submission.

Parameters

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

Overrides WebformMessageManagerInterface::setWebformSubmission

File

src/WebformMessageManager.php, line 145

Class

WebformMessageManager
Defines the webform message (and login) manager.

Namespace

Drupal\webform

Code

public function setWebformSubmission(WebformSubmissionInterface $webform_submission = NULL) {
  $this->webformSubmission = $webform_submission;
  if ($webform_submission) {
    $this->webform = $webform_submission
      ->getWebform();
    $this->sourceEntity = $webform_submission
      ->getSourceEntity();
  }
}