You are here

function _taxonomy_menu_get_vid_by_tid in Taxonomy menu 7

Same name and namespace in other branches
  1. 8 taxonomy_menu.database.inc \_taxonomy_menu_get_vid_by_tid()
  2. 6.2 taxonomy_menu.database.inc \_taxonomy_menu_get_vid_by_tid()
  3. 7.2 taxonomy_menu.database.inc \_taxonomy_menu_get_vid_by_tid()

Gets the vocabulary for a taxonomy term ID.

Parameters

array $tids: Taxonomy term IDs.

Return value

$vid Vocabulary ID.

File

./taxonomy_menu.database.inc, line 236
Database functions

Code

function _taxonomy_menu_get_vid_by_tid($tids) {
  if ($tids) {
    $result = db_select('term_data')
      ->condition('tid', $tids, 'IN')
      ->fields('term_data', array(
      'vid',
    ))
      ->distinct()
      ->execute();
    return $result
      ->fetchAllAssoc('vid');
  }
}