You are here

function taxonomy_csv_term_get_tids_from_vocabulary in Taxonomy CSV import/export 6.5

Return an array of all term ids of a given vocabulary.

Parameters

$vid: The vocabulary id from where to fetch term ids.

Return value

Array of term ids.

1 call to taxonomy_csv_term_get_tids_from_vocabulary()
_taxonomy_csv_import_vocabulary_prepare in import/taxonomy_csv.import.api.inc
Prepare a vocabulary for import.

File

./taxonomy_csv.term.api.inc, line 109
Find, get and set full or detail term items.

Code

function taxonomy_csv_term_get_tids_from_vocabulary($vid) {
  $tids = array();
  $sql = '
    SELECT t.tid
    FROM {term_data} t
    WHERE t.vid = %d
  ';
  $args = array(
    $vid,
  );
  $result = db_query($sql, $args);
  while ($term = db_fetch_object($result)) {
    $tids[] = $term->tid;
  }
  return $tids;
}