comparison core/modules/taxonomy/src/VocabularyStorage.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 129ea1e6d783
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\taxonomy;
4
5 use Drupal\Core\Config\Entity\ConfigEntityStorage;
6
7 /**
8 * Defines a storage handler class for taxonomy vocabularies.
9 */
10 class VocabularyStorage extends ConfigEntityStorage implements VocabularyStorageInterface {
11
12 /**
13 * {@inheritdoc}
14 */
15 public function resetCache(array $ids = NULL) {
16 drupal_static_reset('taxonomy_vocabulary_get_names');
17 parent::resetCache($ids);
18 }
19
20 /**
21 * {@inheritdoc}
22 */
23 public function getToplevelTids($vids) {
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();
25 }
26
27 }