function taxonomy_vocabulary_load

Same name in other branches
  1. 7.x modules/taxonomy/taxonomy.module \taxonomy_vocabulary_load()

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.0.0 and is removed from drupal:9.0.0. Use \Drupal\taxonomy\Entity\Vocabulary::load().

See also

https://www.drupal.org/node/2266845

1 call to taxonomy_vocabulary_load()
TaxonomyLegacyTest::testEntityLegacyCode in core/modules/taxonomy/tests/src/Kernel/TaxonomyLegacyTest.php
@expectedDeprecation taxonomy_term_load_multiple() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\taxonomy\Entity\Term::loadMultiple(). See https://www.drupal.org/node/2266845 @expectedDeprecation…

File

core/modules/taxonomy/taxonomy.module, line 436

Code

function taxonomy_vocabulary_load($vid) {
    @trigger_error('taxonomy_vocabulary_load() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \\Drupal\\taxonomy\\Entity\\Vocabulary::load(). See https://www.drupal.org/node/2266845', E_USER_DEPRECATED);
    return Vocabulary::load($vid);
}

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