You are here

function hosting_server_init_services in Hostmaster (Aegir) 6

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 modules/hosting/server/hosting_server.module
Implementation of hook_load().

File

modules/hosting/server/hosting_server.module, line 153

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;
}