You are here

public function WebformSubmissionLockAction::execute in Webform 6.x

Same name and namespace in other branches
  1. 8.5 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();
}