You are here

function hosting_get_sites_by_status in Hosting 7.3

Same name and namespace in other branches
  1. 5 site/hosting_site.module \hosting_get_sites_by_status()
  2. 6.2 site/hosting_site.module \hosting_get_sites_by_status()
  3. 7.4 site/hosting_site.module \hosting_get_sites_by_status()

Retrieve sites on a specific platform, with a specific status

File

site/hosting_site.module, line 522
Contains hook implementations for Hosting site module.

Code

function hosting_get_sites_by_status($platform, $status) {
  $nodes = array();
  $result = db_query("SELECT nid FROM {hosting_site} WHERE platform = :platform AND status = :status", array(
    ':platform' => $platform,
    ':status' => $status,
  ));
  while ($nid = $result
    ->fetch()) {
    $nodes[$nid->nid] = node_load($nid->nid);
  }
  return $nodes;
}