_domain_write_records

Definition

_domain_write_records($nid, $grants = array())
domain.module, line 899

Description

Store node_access records in the {domain_access{} table.

Parameters

$nid The node id being acted upon.

$grants The grants passed by hook_node_access_records().

Code

function _domain_write_records($nid, $grants = array()) {
  if ($nid > 0 && !empty($grants)) {
    db_query("DELETE FROM {domain_access} WHERE nid = %d", $nid);
    foreach ($grants as $grant) {
      db_query("INSERT INTO {domain_access} (nid, gid, realm) VALUES (%d, %d, '%s')", $nid, $grant['gid'], $grant['realm']);
    }
  }
}