You are here

function classified_delete in Classified Ads 7.3

Same name and namespace in other branches
  1. 6.3 classified.module \classified_delete()

Implements hook_delete().

File

./classified.module, line 887
A pure D7 classified ads module inspired by the ed_classified module.

Code

function classified_delete($node) {
  $ret = db_delete('classified_node')
    ->condition('nid', $node->nid)
    ->execute();

  // PDO errors return NULL, not FALSE on error.
  if ($ret === NULL) {
    watchdog('classified', 'Error deleting node @nid: @title', array(
      '@nid' => $node->nid,
      '@title' => $node->title,
    ), WATCHDOG_ERROR, l($node->title, 'node/' . $node->nid));
  }
  else {
    cache_clear_all('classified:overview', 'cache');
  }
}