You are here

function webform_delete in Webform 6.2

Same name and namespace in other branches
  1. 5.2 webform.module \webform_delete()
  2. 5 webform.module \webform_delete()

Implementation of hook_delete().

File

./webform.module, line 513

Code

function webform_delete(&$node) {

  // Allow components clean up extra data, such as uploaded files.
  module_load_include('inc', 'webform', 'webform_components');
  foreach ($node->webform['components'] as $cid => $component) {
    webform_component_delete($node->nid, $cid);
  }

  // Remove any trace of webform data from the database.
  db_query('DELETE FROM {webform} WHERE nid = %d', $node->nid);
  db_query('DELETE FROM {webform_component} WHERE nid = %d', $node->nid);
  db_query('DELETE FROM {webform_roles} WHERE nid = %d', $node->nid);
  db_query('DELETE FROM {webform_submissions} WHERE nid = %d', $node->nid);
  db_query('DELETE FROM {webform_submitted_data} WHERE nid = %d', $node->nid);
}