You are here

public function WebformEntityCloseAction::execute in Webform 8.5

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

Executes the plugin.

Overrides ExecutableInterface::execute

File

src/Plugin/Action/WebformEntityCloseAction.php, line 23

Class

WebformEntityCloseAction
Closes a webform.

Namespace

Drupal\webform\Plugin\Action

Code

public function execute($entity = NULL) {

  /** @var \Drupal\webform\WebformInterface $entity */
  $entity
    ->setStatus(WebformInterface::STATUS_CLOSED)
    ->save();
}