You are here

public function TaxonomyManagerHelper::vocabularyIsEmpty in Taxonomy Manager 2.0.x

Same name and namespace in other branches
  1. 8 src/TaxonomyManagerHelper.php \Drupal\taxonomy_manager\TaxonomyManagerHelper::vocabularyIsEmpty()

Checks if voc has terms.

Parameters

int $vid: The term ID.

Return value

bool True, if terms already exists, else false

File

src/TaxonomyManagerHelper.php, line 86

Class

TaxonomyManagerHelper
Class for taxonomy manager helper.

Namespace

Drupal\taxonomy_manager

Code

public function vocabularyIsEmpty($vid) {

  /** @var \Drupal\taxonomy\TermStorageInterface $term_storage */
  $term_storage = $this->taxonomyTypeManager;
  return empty($term_storage
    ->loadTree($vid));
}