You are here

private function ExpireDomain::getDomains in Cache Expiration 7.2

Get domains the node is currently published to.

Parameters

$node: Node object.

Return value

array List of domains.

File

includes/expire.domain.inc, line 24
Provides class that expires domain base urls.

Class

ExpireDomain
@file Provides class that expires domain base urls.

Code

private function getDomains($node) {
  $domains = array();
  if ($node->nid) {
    $result = db_query("SELECT gid FROM {domain_access} WHERE nid = :nid", array(
      ':nid' => $node->nid,
    ));
    foreach ($result as $row) {
      $domains[$row->gid] = $row->gid;
    }
  }
  elseif ($node->mail && $node->name) {
    $result = db_query("SELECT domain_id FROM {domain_editor} WHERE uid = :uid", array(
      ':uid' => $node->uid,
    ));
    foreach ($result as $row) {
      $domains[$row->domain_id] = $row->domain_id;
    }
  }
  return $domains;
}