You are here

protected function GroupRevisionCheck::countDefaultLanguageRevisions in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/Access/GroupRevisionCheck.php \Drupal\group\Entity\Access\GroupRevisionCheck::countDefaultLanguageRevisions()

Counts the number of revisions in the default language.

Parameters

\Drupal\group\Entity\GroupInterface $group: The group.

Return value

int The number of revisions in the default language.

1 call to GroupRevisionCheck::countDefaultLanguageRevisions()
GroupRevisionCheck::checkAccess in src/Entity/Access/GroupRevisionCheck.php
Checks group revision access.

File

src/Entity/Access/GroupRevisionCheck.php, line 168

Class

GroupRevisionCheck
Checks access to a group revision.

Namespace

Drupal\group\Entity\Access

Code

protected function countDefaultLanguageRevisions(GroupInterface $group) {
  return (int) $this->entityTypeManager
    ->getStorage('group')
    ->getQuery()
    ->allRevisions()
    ->accessCheck(FALSE)
    ->condition('id', $group
    ->id())
    ->condition('default_langcode', 1)
    ->count()
    ->execute();
}