8.5.x taxonomy.module taxonomy_vocabulary_load($vid)
8.0.x taxonomy.module taxonomy_vocabulary_load($vid)
8.1.x taxonomy.module taxonomy_vocabulary_load($vid)
8.2.x taxonomy.module taxonomy_vocabulary_load($vid)
8.3.x taxonomy.module taxonomy_vocabulary_load($vid)
8.4.x taxonomy.module taxonomy_vocabulary_load($vid)
8.6.x taxonomy.module taxonomy_vocabulary_load($vid)
6.x taxonomy.module taxonomy_vocabulary_load($vid, $reset = FALSE)
7.x taxonomy.module taxonomy_vocabulary_load($vid)

Return the taxonomy vocabulary entity matching a vocabulary ID.

Parameters

int $vid: The vocabulary's ID.

Return value

\Drupal\taxonomy\Entity\Vocabulary|null The taxonomy vocabulary entity, if exists, NULL otherwise. Results are statically cached.

Deprecated

in Drupal 8.x, will be removed before Drupal 9.0. Use \Drupal\taxonomy\Entity\Vocabulary::load().

File

core/modules/taxonomy/taxonomy.module, line 409
Enables the organization of content into categories.

Code

function taxonomy_vocabulary_load($vid) {
  return Vocabulary::load($vid);
}

Comments

dongtian’s picture

It should be:
$vocabulary = \Drupal\taxonomy\Entity\Vocabulary::load($vid);
or
$vocabulary = \Drupal::entityTypeManager()->getStorage('taxonomy_vocabulary')->load($vid);