You are here

function webfm_dbdelete_attachments in Web File Manager 5

webfm_dbdelete_attachments - deletes a nodes file associations.

Parameters

int $id - Node id.:

Return value

bool - TRUE if success - else FALSE

1 call to webfm_dbdelete_attachments()
webfm_nodeapi in ./webfm.module
Implementation of hook_nodeapi().

File

./webfm.module, line 3017

Code

function webfm_dbdelete_attachments($nid) {
  $query = 'DELETE FROM {webfm_attach} WHERE nid = %d';
  $result = db_query($query, $nid);
  if ($result === FALSE) {
    drupal_set_message(t('Failed to remove file attachments for deleted node %nid', array(
      '%nid' => $nid,
    )));
    return FALSE;
  }
  return TRUE;
}