You are here

function hosting_get_sites_on_db_server in Hosting 7.4

Same name and namespace in other branches
  1. 7.3 db_server/hosting_db_server.module \hosting_get_sites_on_db_server()

Get the databases hosted on a server.

Parameters

int $db_server_id: The node ID of the db server.

1 call to hosting_get_sites_on_db_server()
hosting_client_node_access_records in client/hosting_client.access.inc
Implements hook_node_access_records().

File

db_server/hosting_db_server.module, line 54
Allow Hostmaster to configure database servers.

Code

function hosting_get_sites_on_db_server($db_server_id) {
  $return = array();
  $result = db_query("SELECT nid, db_name FROM {hosting_site} WHERE db_server = :id", array(
    ':id' => $db_server_id,
  ));
  while ($site = $result
    ->fetch()) {
    $return[$site->nid] = $site->db_name;
  }
  return $return;
}