You are here

protected function CmsBlogUninstallValidator::hasBlogNodes in Glazed CMS Blog 8

Determines if there is any CMS Blog nodes or not.

Return value

bool TRUE if there are blog nodes, FALSE otherwise.

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

File

src/CmsBlogUninstallValidator.php, line 61

Class

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

Namespace

Drupal\cms_blog

Code

protected function hasBlogNodes() {
  $nodes = $this->queryFactory
    ->get('node')
    ->condition('type', 'cms_blog')
    ->accessCheck(FALSE)
    ->range(0, 1)
    ->execute();
  return !empty($nodes);
}