You are here

public function WebformSubmission::convert in Webform 8.5

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

Convert anonymous submission to authenticated.

Parameters

\Drupal\user\UserInterface $account: An authenticated user account.

Overrides WebformSubmissionInterface::convert

File

src/Entity/WebformSubmission.php, line 909

Class

WebformSubmission
Defines the WebformSubmission entity.

Namespace

Drupal\webform\Entity

Code

public function convert(UserInterface $account) {
  $this->converting = TRUE;
  $this
    ->setOwner($account);
  $this
    ->save();
  $this->converting = FALSE;
}