You are here

function domain_source_node_insert in Domain Access 7.2

Same name and namespace in other branches
  1. 7.3 domain_source/domain_source.module \domain_source_node_insert()

Implements hook_node_insert()

1 call to domain_source_node_insert()
domain_source_node_update in domain_source/domain_source.module
Implements hook_node_update()

File

domain_source/domain_source.module, line 196
Creates a source domain for linking to content from other domains.

Code

function domain_source_node_insert($node) {

  // If not set, we ignore.
  if (!isset($node->domain_source) || is_null($node->domain_source)) {
    return;
  }
  domain_source_node_delete($node);
  db_insert('domain_source')
    ->fields(array(
    'nid' => $node->nid,
    'domain_id' => $node->domain_source,
  ))
    ->execute();

  // Clear the cache.
  domain_source_lookup($node->nid, array(), NULL, TRUE);
}