public function WebformEntityCloseAction::execute in Webform 6.x
Same name and namespace in other branches
- 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\ActionCode
public function execute($entity = NULL) {
/** @var \Drupal\webform\WebformInterface $entity */
$entity
->setStatus(WebformInterface::STATUS_CLOSED)
->save();
}