You are here

public function WebformEntityUnarchiveAction::execute in Webform 8.5

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

Executes the plugin.

Overrides ExecutableInterface::execute

File

src/Plugin/Action/WebformEntityUnarchiveAction.php, line 22

Class

WebformEntityUnarchiveAction
Unarchives a webform.

Namespace

Drupal\webform\Plugin\Action

Code

public function execute($entity = NULL) {

  /** @var \Drupal\webform\WebformInterface $entity */
  $entity
    ->set('archive', FALSE)
    ->save();
}