You are here

function hosting_package_update in Hosting 5

Same name and namespace in other branches
  1. 6.2 package/hosting_package.module \hosting_package_update()
  2. 7.4 package/hosting_package.module \hosting_package_update()
  3. 7.3 package/hosting_package.module \hosting_package_update()

Implementation of hook_update().

As an existing node is being updated in the database, we need to do our own database updates.

File

package/hosting_package.module, line 192

Code

function hosting_package_update($node) {

  // if this is a new node or we're adding a new revision,
  if ($node->revision) {
    hosting_package_insert($node);
  }
  else {
    db_query("UPDATE {hosting_package} SET package_type = '%s', short_name = '%s', description = '%s' WHERE nid=%d", $node->package_type, $node->short_name, $node->description, $node->nid);
  }
}