function taxonomy_csv_vocabulary_get_tids in Taxonomy CSV import/export 7.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.
2 calls to taxonomy_csv_vocabulary_get_tids()
- taxonomy_csv_vocabulary_get_terms in ./
taxonomy_csv.vocabulary.api.inc - Return an array of all full terms of a given vocabulary.
- _taxonomy_csv_import_vocabulary_prepare in import/
taxonomy_csv.import.api.inc - Prepare a vocabulary for import.
File
- ./
taxonomy_csv.vocabulary.api.inc, line 105 - Prepare and manage vocabularies.
Code
function taxonomy_csv_vocabulary_get_tids($vid) {
// Tids are available in drupal_static('taxonomy_get_tree:terms'), but we
// prefer to use an entity query to avoid issue with cache, if not updated.
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'taxonomy_term')
->propertyCondition('vid', $vid);
$result = $query
->execute();
return isset($result['taxonomy_term']) ? array_keys($result['taxonomy_term']) : array();
}