function ForumUninstallValidator::getForumVocabulary

Same name in other branches
  1. 9 core/modules/forum/src/ForumUninstallValidator.php \Drupal\forum\ForumUninstallValidator::getForumVocabulary()
  2. 10 core/modules/forum/src/ForumUninstallValidator.php \Drupal\forum\ForumUninstallValidator::getForumVocabulary()
  3. 11.x core/modules/forum/src/ForumUninstallValidator.php \Drupal\forum\ForumUninstallValidator::getForumVocabulary()

Returns the vocabulary configured for forums.

Return value

\Drupal\taxonomy\VocabularyInterface The vocabulary entity for forums.

1 call to ForumUninstallValidator::getForumVocabulary()
ForumUninstallValidator::validate in core/modules/forum/src/ForumUninstallValidator.php
Determines the reasons a module can not be uninstalled.

File

core/modules/forum/src/ForumUninstallValidator.php, line 118

Class

ForumUninstallValidator
Prevents forum module from being uninstalled whilst any forum nodes exist or there are any terms in the forum vocabulary.

Namespace

Drupal\forum

Code

protected function getForumVocabulary() {
    $vid = $this->configFactory
        ->get('forum.settings')
        ->get('vocabulary');
    return $this->entityTypeManager
        ->getStorage('taxonomy_vocabulary')
        ->load($vid);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.