You are here

protected function CmsBlogUninstallValidator::hasTerms in Glazed CMS Blog 8

Determines if there are any taxonomy terms for a specified vocabulary.

Parameters

int $vid: The ID of vocabulary to check for terms.

Return value

bool TRUE if there are terms for this vocabulary, FALSE otherwise.

1 call to CmsBlogUninstallValidator::hasTerms()
CmsBlogUninstallValidator::validate in src/CmsBlogUninstallValidator.php
Determines the reasons a module can not be uninstalled.

File

src/CmsBlogUninstallValidator.php, line 79

Class

CmsBlogUninstallValidator
Prevents CMS Blog module from being uninstalled if any blog entries exist.

Namespace

Drupal\cms_blog

Code

protected function hasTerms($vid) {
  $terms = $this->queryFactory
    ->get('taxonomy_term')
    ->condition('vid', $vid)
    ->accessCheck(FALSE)
    ->range(0, 1)
    ->execute();
  return !empty($terms);
}