You are here

function hosting_platform_update in Hosting 5

Same name and namespace in other branches
  1. 6.2 platform/hosting_platform.module \hosting_platform_update()
  2. 7.4 platform/hosting_platform.module \hosting_platform_update()
  3. 7.3 platform/hosting_platform.module \hosting_platform_update()

Implementation of hook_update().

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

File

platform/hosting_platform.module, line 152
Platform node type definition

Code

function hosting_platform_update($node) {

  // if this is a new node or we're adding a new revision,
  if ($node->revision) {
    hosting_platform_insert($node);
  }
  else {
    if ($node->default_platform == 1) {
      variable_set('hosting_default_platform', $node->nid);
    }
    db_query("UPDATE {hosting_platform} SET publish_path = '%s', web_server = %d, verified = %d WHERE nid=%d", $node->publish_path, $node->web_server, $node->verified, $node->nid);
  }
}