Same name and namespace in other branches
  1. 4.6.x modules/book.module \book_update()

Implementation of hook_update().

File

modules/book.module, line 189
Allows users to collaboratively author a book.

Code

function book_update($node) {
  if ($node->revision) {
    db_query("INSERT INTO {book} (nid, vid, parent, weight) VALUES (%d, %d, %d, %d)", $node->nid, $node->vid, $node->parent, $node->weight);
  }
  else {
    db_query("UPDATE {book} SET parent = %d, weight = %d WHERE vid = %d", $node->parent, $node->weight, $node->vid);
  }
}