You are here

class DeleteWebformSubmission in RULES WEBFORM 3.x

Same name and namespace in other branches
  1. 8 src/Plugin/RulesAction/DeleteWebformSubmission.php \Drupal\rules_webform\Plugin\RulesAction\DeleteWebformSubmission

Action for deletion of a webform submission.

The action edit page is not displayed to a user and a user doesn't input any values. "webform_info" context is mapping programmatically.

Plugin annotation


@RulesAction(
  id = "delete_webform_submission",
  label = @Translation("Delete webform submission"),
  category = @Translation("A Webform"),
  context_definitions = {
    "webform_info" = @ContextDefinition("webform_info",
      label = @Translation("Webform info")
    )
  }
)

Hierarchy

Expanded class hierarchy of DeleteWebformSubmission

File

src/Plugin/RulesAction/DeleteWebformSubmission.php, line 24

Namespace

Drupal\rules_webform\Plugin\RulesAction
View source
class DeleteWebformSubmission extends RulesActionBase {

  /**
   * Delete the submission of the selected webform.
   *
   * @param array $webform_info
   *   Array with information about webform submission data.
   */
  protected function doExecute(array $webform_info) {
    $webform_info['submission']
      ->delete();
    \Drupal::state()
      ->delete('rules_webform.submission');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeleteWebformSubmission::doExecute protected function Delete the submission of the selected webform.