You are here

function _cctgas_node_in_terms in cctags 7

1 call to _cctgas_node_in_terms()
cctags_invoke_cctags_term_count in ./cctags.module
Invoke a hook_cctags_term_count() operation in all modules.

File

./cctags.module, line 671

Code

function _cctgas_node_in_terms($tid) {
  $query = db_select('taxonomy_term_data', 't');
  $query
    ->join('taxonomy_index', 'i', 'i.tid = t.tid');
  $query
    ->addField('i', 'nid');
  $query
    ->condition('t.tid', $tid);
  $query
    ->addTag('node_access');
  $tids = $query
    ->execute()
    ->fetchCol();
  return count($tids);
}