You are here

public function WebformEntityCloseAction::execute in Webform 6.x

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