You are here

function hosting_platform_load in Hosting 6.2

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

Implementation of hook_load().

Parameters

node: Node object

File

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

Code

function hosting_platform_load($node) {
  $additions = db_fetch_object(db_query('SELECT publish_path, makefile, verified, web_server, status AS platform_status, make_working_copy FROM {hosting_platform} WHERE vid = %d', $node->vid));

  // Avoid PHP 5.4 warning when platform doesn't exist yet.
  // See: https://drupal.org/node/1940378
  $additions = $additions ? $additions : new stdClass();
  $iid = db_result(db_query("SELECT iid FROM {hosting_package_instance} i left join {hosting_package} p on p.nid=i.package_id WHERE p.package_type='platform' AND i.rid=%d", $node->nid));
  $additions->release = hosting_package_instance_load($iid);
  $additions->profiles = hosting_get_profiles($node->nid, 'short_name');
  return $additions;
}