You are here

function _nat_save_association in Node Auto Term [NAT] 6

Same name and namespace in other branches
  1. 5 nat.module \_nat_save_association()
  2. 6.2 nat.module \_nat_save_association()
  3. 7.2 nat.module \_nat_save_association()
  4. 7 nat.module \_nat_save_association()

Save node-term associations in the NAT table.

Parameters

Integer $nid: Node ID of the node.

Array $terms: NAT-term objects of the above node.

2 calls to _nat_save_association()
nat_nodeapi in ./nat.module
Implementation of hook_nodeapi().
_nat_sync_associations in ./nat.admin.inc
Synchronize NAT node-term relationships. Create associated terms for node where missing.

File

./nat.module, line 575
NAT - node auto term - is a helper module that automatically creates a term using the same title as a node.

Code

function _nat_save_association($nid, $terms) {
  foreach ($terms as $term) {
    $term['nid'] = $nid;
    drupal_write_record('nat', $term);
  }
}