public VocabularyStorage::getToplevelTids($vids)
Gets top-level term IDs of vocabularies.
Parameters
array $vids: Array of vocabulary IDs.
Return value
array Array of top-level term IDs.
Overrides VocabularyStorageInterface::getToplevelTids
File
- core/modules/taxonomy/src/VocabularyStorage.php, line 23
Class
- VocabularyStorage
- Defines a storage handler class for taxonomy vocabularies.
Namespace
Drupal\taxonomy
Code
public function getToplevelTids($vids) { return db_query('SELECT t.tid FROM {taxonomy_term_data} t INNER JOIN {taxonomy_term_hierarchy} th ON th.tid = t.tid WHERE t.vid IN ( :vids[] ) AND th.parent = 0', array(':vids[]' => $vids))->fetchCol(); }
Please login to continue.