You are here

function hosting_platform_update in Hosting 6.2

Same name and namespace in other branches
  1. 5 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 403
Platform node type definition.

Code

function hosting_platform_update($node) {

  // if this is a new node or we're adding a new revision,
  if (!empty($node->revision)) {
    hosting_platform_insert($node);
  }
  else {
    if ($node->platform_status == HOSTING_PLATFORM_DELETED) {
      $node->no_verify = TRUE;
    }
    db_query("UPDATE {hosting_platform} SET publish_path = '%s', makefile = '%s', web_server = %d, verified = %d, status= %d, make_working_copy = %d WHERE nid=%d", $node->publish_path, $node->makefile, $node->web_server, $node->verified, $node->platform_status, $node->make_working_copy, $node->nid);
  }
  if (!$node->no_verify) {
    hosting_add_task($node->nid, 'verify');
  }
}