You are here

public function WebformDevelCommands::drush_webform_devel_reset in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_devel/src/Commands/WebformDevelCommands.php \Drupal\webform_devel\Commands\WebformDevelCommands::drush_webform_devel_reset()

Executes webform devel reset.

@command webform:devel:reset @aliases wfdr

See also

drush_webform_devel_reset()

File

modules/webform_devel/src/Commands/WebformDevelCommands.php, line 105

Class

WebformDevelCommands
Webform devel commandfile.

Namespace

Drupal\webform_devel\Commands

Code

public function drush_webform_devel_reset() {
  if (!$this
    ->io()
    ->confirm(dt("Are you sure you want repair the Webform module's admin settings and webforms?"))) {
    throw new UserAbortException();
  }
  $this
    ->output()
    ->writeln(dt('Resetting message closed via State API…'));
  $this->state
    ->delete('webform.element.message');
  $this
    ->output()
    ->writeln(dt('Resetting message closed via User Data…'));
  $this->userData
    ->delete('webform', NULL, 'webform.element.message');
}