You are here

public function WebformSubmissionLockAction::execute in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/Action/WebformSubmissionLockAction.php \Drupal\webform\Plugin\Action\WebformSubmissionLockAction::execute()

Executes the plugin.

Overrides ExecutableInterface::execute

File

src/Plugin/Action/WebformSubmissionLockAction.php, line 22

Class

WebformSubmissionLockAction
Locks a webform submission.

Namespace

Drupal\webform\Plugin\Action

Code

public function execute($entity = NULL) {

  /** @var \Drupal\webform\WebformSubmissionInterface $entity */
  $entity
    ->setLocked(TRUE)
    ->save();
}