public function WebformEntityArchiveAction::execute in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/Action/WebformEntityArchiveAction.php \Drupal\webform\Plugin\Action\WebformEntityArchiveAction::execute()
Executes the plugin.
Overrides ExecutableInterface::execute
File
- src/
Plugin/ Action/ WebformEntityArchiveAction.php, line 22
Class
- WebformEntityArchiveAction
- Archives a webform.
Namespace
Drupal\webform\Plugin\ActionCode
public function execute($entity = NULL) {
/** @var \Drupal\webform\WebformInterface $entity */
$entity
->set('archive', TRUE)
->save();
}