You are here

function hosting_server_load in Hosting 7.3

Same name and namespace in other branches
  1. 6.2 server/hosting_server.module \hosting_server_load()
  2. 7.4 server/hosting_server.module \hosting_server_load()

Implements hook_load().

File

server/hosting_server.module, line 627

Code

function hosting_server_load($nodes) {
  foreach ($nodes as $nid => &$node) {
    $additions = db_query('SELECT human_name, verified, status AS server_status FROM {hosting_server} WHERE vid = :vid', array(
      ':vid' => $node->vid,
    ))
      ->fetch();

    // Avoid PHP 5.4 warning when platform doesn't exist yet.
    // See: https://drupal.org/node/1940378
    $additions = $additions ? $additions : new stdClass();
    hosting_server_init_services($node);
    hosting_server_invoke_services($node, 'load');
    $additions->services = $node->services;
    $additions->ip_addresses = _hosting_ip_load($node);
    foreach ($additions as $property => &$value) {
      $node->{$property} = is_numeric($value) ? (int) $value : $value;
    }
  }
}