You are here

function _nat_save_association in Node Auto Term [NAT] 5

Same name and namespace in other branches
  1. 6.2 nat.module \_nat_save_association()
  2. 6 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

$nid: Node ID of the node.

$terms: NAT-terms of the above node.

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

File

./nat.module, line 662
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) {
    db_query("INSERT INTO {nat} (nid, tid, vid) VALUES (%d, %d, %d)", $nid, $term['tid'], $term['vid']);
  }
}