You are here

function _taxonomy_manager_tree_term_children_count in Taxonomy Manager 7

Same name and namespace in other branches
  1. 6.2 taxonomy_manager.module \_taxonomy_manager_tree_term_children_count()
  2. 6 taxonomy_manager.module \_taxonomy_manager_tree_term_children_count()

Parameters

$tid:

Return value

children count

3 calls to _taxonomy_manager_tree_term_children_count()
taxonomy_manager_taxonomy_manager_tree_operations in ./taxonomy_manager.module
function gets called by the taxonomy_manager_tree form type ('taxonomy_manager_'. form_id .'_operations') return an form array with values to show next to every term value
taxonomy_manager_tree_term_extra_info in ./taxonomy_manager.module
returns some additional information about the term which gets added to the link title
_taxonomy_manager_tree_term_set_class in ./taxonomy_manager.module
calculates class type (expandable, lastExpandable) for current element

File

./taxonomy_manager.module, line 713
Taxonomy Manager

Code

function _taxonomy_manager_tree_term_children_count($tid) {
  static $tids = array();
  if (!isset($tids[$tid])) {
    $query = db_select('taxonomy_term_hierarchy', 'h');
    $query
      ->condition('h.parent', $tid);
    $tids[$tid] = $query
      ->countQuery()
      ->execute()
      ->fetchField();
  }
  return $tids[$tid];
}