You are here

function webform_results_clear in Webform 6.2

Same name and namespace in other branches
  1. 5.2 webform_report.inc \webform_results_clear()
  2. 6.3 includes/webform.report.inc \webform_results_clear()
  3. 7.4 includes/webform.report.inc \webform_results_clear()
  4. 7.3 includes/webform.report.inc \webform_results_clear()

Delete all submissions for a node.

Parameters

$nid: The node id whose submissions will be deleted.

1 call to webform_results_clear()
webform_results_clear_form_submit in ./webform_report.inc

File

./webform_report.inc, line 263
This file includes helper functions for creating reports for webform.module

Code

function webform_results_clear($nid) {
  $node = node_load($nid);
  $submissions = webform_get_submissions($nid);
  foreach ($submissions as $submission) {
    webform_submission_delete($node, $submission);
  }
}