You are here

function _webform_delete_component in Webform 6.3

Same name and namespace in other branches
  1. 7.4 webform.api.php \_webform_delete_component()
  2. 7.3 webform.api.php \_webform_delete_component()

Delete operation for a component or submission.

Parameters

$component: A Webform component array.

$value: An array of information containing the submission result, directly correlating to the webform_submitted_data database schema.

Related topics

File

./webform.api.php, line 742
Sample hooks demonstrating usage in Webform.

Code

function _webform_delete_component($component, $value) {

  // Delete corresponding files when a submission is deleted.
  $filedata = unserialize($value['0']);
  if (isset($filedata['filepath']) && is_file($filedata['filepath'])) {
    unlink($filedata['filepath']);
    db_query("DELETE FROM {files} WHERE filepath = '%s'", $filedata['filepath']);
  }
}