You are here

function classified_update in Classified Ads 7.3

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

Implements hook_update().

File

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

Code

function classified_update($node) {
  if (!empty($node->revision)) {
    classified_insert($node);
  }
  else {
    $ret = drupal_write_record('classified_node', $node, array(
      'nid',
      'vid',
    ));
    if ($ret === FALSE) {
      watchdog('classified', 'Error updating ad @nid: "@title"', array(
        '@nid' => $node->nid,
        '@title' => $node->title,
      ), WATCHDOG_ERROR, l($node->title, 'node/' . $node->nid));
    }
    else {
      cache_clear_all('classified:overview', 'cache');
    }
  }
}