You are here

function quotes_update in Quotes 7

Same name and namespace in other branches
  1. 5 quotes.module \quotes_update()
  2. 6 quotes.module \quotes_update()

Implements hook_update().

File

./quotes.module, line 623
The quotes module allows users to maintain a list of quotes that can be displayed in any number of administrator-defined quote blocks.

Code

function quotes_update($node) {
  $aid = _quotes_handle_author($node->quotes_author);
  if ($node->revision) {
    quotes_insert($node);
  }
  else {
    db_update('quotes')
      ->fields(array(
      'aid' => 0 + $aid,
      'citation' => $node->quotes_citation,
      'promote' => (int) $node->quotes_promote,
    ))
      ->condition('nid', $node->nid)
      ->condition('vid', $node->vid)
      ->execute();
  }
}