You are here

function hosting_platform_update in Hostmaster (Aegir) 6

Implementation of hook_update().

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

File

modules/hosting/platform/hosting_platform.module, line 275
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 WHERE nid=%d", $node->publish_path, $node->makefile, $node->web_server, $node->verified, $node->platform_status, $node->nid);
  }
  if (!$node->no_verify) {
    hosting_add_task($node->nid, 'verify');
  }
}