You are here

function domain_id_list in Domain Access 7.3

Return all active domain_ids.

Parameters

$reset: A boolean flag indicating whether to reset the static array or not.

Return value

An array of domain_ids, keyed by machine_name.

2 calls to domain_id_list()
domain_domains in ./domain.module
Return all active domains (including the default) as an array.
domain_get_user_domains in ./domain.module
Get the domains a user is assigned to.
1 string reference to 'domain_id_list'
domain_static_reset in ./domain.module
Clear static caches used for domain listings.

File

./domain.module, line 1276
Core module functions for the Domain Access suite.

Code

function domain_id_list($reset = FALSE) {
  $list =& drupal_static(__FUNCTION__);
  if (isset($list) && empty($reset)) {
    return $list;
  }
  $list = array();
  $result = db_query("SELECT domain_id, machine_name FROM {domain} ORDER BY weight");
  foreach ($result as $data) {
    $list[$data->machine_name] = $data->domain_id;
  }
  return $list;
}