You are here

function _taxonomy_menu_get_vid_by_tid in Taxonomy menu 7.2

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 taxonomy_menu.database.inc \_taxonomy_menu_get_vid_by_tid()

Get the vocabulary for a tid

Parameters

$tid array of tids:

Return value

$vid

File

./taxonomy_menu.database.inc, line 251
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();
    $vids = array();
    return $result
      ->fetchAllAssoc('vid');
  }
}