You are here

function hosting_server_init_services in Hosting 6.2

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

Initializes the service objects associated with a server node object.

Parameters

$node The server node object.:

Return value

The server node object with an additional 'services' property. The services property is an associative array with the name of the service as key, and the service object as value.

1 call to hosting_server_init_services()
hosting_server_load in server/hosting_server.module
Implementation of hook_load().

File

server/hosting_server.module, line 157

Code

function hosting_server_init_services(&$node) {
  $node->services = array();
  $result = db_query("SELECT service, type FROM {hosting_service} WHERE vid=%d AND available=1", $node->vid);
  while ($record = db_fetch_object($result)) {
    $name = $record->service;
    if ($service_object = hosting_services_new_object($name, $record->type, $node)) {
      $node->services[$name] = $service_object;
    }
  }
  return $node;
}