You are here

function hosting_package_update in Hosting 7.3

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

Implements 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 292
Defines package node types

Code

function hosting_package_update($node) {

  // if this is a new node or we're adding a new revision,
  if (!empty($node->revision)) {
    hosting_package_insert($node);
  }
  else {
    db_update('hosting_package')
      ->fields(array(
      'package_type' => $node->package_type,
      'short_name' => $node->short_name,
      'old_short_name' => $node->old_short_name,
      'description' => $node->description,
    ))
      ->condition('nid', $node->nid)
      ->execute();
  }
}