Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / taxonomy / src / VocabularyStorage.php
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     $tids = \Drupal::entityQuery('taxonomy_term')
25       ->condition('vid', $vids, 'IN')
26       ->condition('parent.target_id', 0)
27       ->execute();
28
29     return array_values($tids);
30   }
31
32 }