You are here

function hosting_site_update in Hosting 7.4

Same name and namespace in other branches
  1. 5 site/hosting_site.module \hosting_site_update()
  2. 6.2 site/hosting_site.nodeapi.inc \hosting_site_update()
  3. 7.3 site/hosting_site.nodeapi.inc \hosting_site_update()

Implements hook_update().

File

site/hosting_site.nodeapi.inc, line 392
Site nodeapi implementations.

Code

function hosting_site_update(&$node) {

  // If this is a new node or we're adding a new revision.
  if (!empty($node->revision)) {
    hosting_site_insert($node);
  }
  else {
    $client = hosting_get_client($node->client);
    $node->client = $client->nid;
    if ($node->site_status == HOSTING_SITE_DELETED) {
      $node->no_verify = TRUE;
    }
    db_update('hosting_site')
      ->fields(array(
      'client' => $node->client,
      'db_server' => $node->db_server,
      'db_name' => $node->db_name,
      'platform' => $node->platform,
      'last_cron' => $node->last_cron,
      'cron_key' => $node->cron_key,
      'status' => $node->site_status,
      'profile' => (int) $node->profile,
      'language' => $node->site_language,
      'verified' => $node->verified,
      'file_public_path' => $node->file_public_path,
      'file_private_path' => $node->file_private_path,
      'file_temporary_path' => $node->file_temporary_path,
    ))
      ->condition('vid', $node->vid)
      ->execute();

    // If platform_node is passed in the site node, save it.
    if (isset($node->platform_node->nid)) {
      node_save($node->platform_node);
    }
  }
}