You are here

function apachesolr_exclude_node_node_insert in Apache Solr Exclude Node 7

Implements hook_node_insert().

1 call to apachesolr_exclude_node_node_insert()
apachesolr_exclude_node_node_update in ./apachesolr_exclude_node.module
Implements hook_node_update().

File

./apachesolr_exclude_node.module, line 74
Module file for the Apache Solr Exclude Node module.

Code

function apachesolr_exclude_node_node_insert($node) {

  // Only insert into database if we need to exclude the node.
  if (!empty($node->apachesolr_exclude_node_enabled)) {
    db_insert('apachesolr_exclude_node')
      ->fields(array(
      'nid' => $node->nid,
      'vid' => $node->vid,
      'exclude' => $node->apachesolr_exclude_node_enabled ? 1 : 0,
    ))
      ->execute();
  }
}