annotate core/modules/taxonomy/src/VocabularyStorage.php @ 12:7a779792577d

Update Drupal core to v8.4.5 (via Composer)
author Chris Cannam
date Fri, 23 Feb 2018 15:52:07 +0000
parents 4c8ae668cc8c
children 129ea1e6d783
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\taxonomy;
Chris@0 4
Chris@0 5 use Drupal\Core\Config\Entity\ConfigEntityStorage;
Chris@0 6
Chris@0 7 /**
Chris@0 8 * Defines a storage handler class for taxonomy vocabularies.
Chris@0 9 */
Chris@0 10 class VocabularyStorage extends ConfigEntityStorage implements VocabularyStorageInterface {
Chris@0 11
Chris@0 12 /**
Chris@0 13 * {@inheritdoc}
Chris@0 14 */
Chris@0 15 public function resetCache(array $ids = NULL) {
Chris@0 16 drupal_static_reset('taxonomy_vocabulary_get_names');
Chris@0 17 parent::resetCache($ids);
Chris@0 18 }
Chris@0 19
Chris@0 20 /**
Chris@0 21 * {@inheritdoc}
Chris@0 22 */
Chris@0 23 public function getToplevelTids($vids) {
Chris@0 24 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', [':vids[]' => $vids])->fetchCol();
Chris@0 25 }
Chris@0 26
Chris@0 27 }