You are here

protected function GroupRevisionDeleteForm::countRevisions in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/Form/GroupRevisionDeleteForm.php \Drupal\group\Entity\Form\GroupRevisionDeleteForm::countRevisions()

Counts the number of revisions.

Parameters

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

Return value

int The number of revisions.

1 call to GroupRevisionDeleteForm::countRevisions()
GroupRevisionDeleteForm::submitForm in src/Entity/Form/GroupRevisionDeleteForm.php
Form submission handler.

File

src/Entity/Form/GroupRevisionDeleteForm.php, line 136

Class

GroupRevisionDeleteForm
Provides a form for deleting a group revision.

Namespace

Drupal\group\Entity\Form

Code

protected function countRevisions(GroupInterface $group) {
  return $this->groupStorage
    ->getQuery()
    ->allRevisions()
    ->condition('id', $group
    ->id())
    ->count()
    ->execute();
}