You are here

public function GroupStatistics::getGroupMemberCount in Open Social 8.9

Same name and namespace in other branches
  1. 8.8 modules/social_features/social_group/src/GroupStatistics.php \Drupal\social_group\GroupStatistics::getGroupMemberCount()
  2. 10.3.x modules/social_features/social_group/src/GroupStatistics.php \Drupal\social_group\GroupStatistics::getGroupMemberCount()
  3. 10.0.x modules/social_features/social_group/src/GroupStatistics.php \Drupal\social_group\GroupStatistics::getGroupMemberCount()
  4. 10.1.x modules/social_features/social_group/src/GroupStatistics.php \Drupal\social_group\GroupStatistics::getGroupMemberCount()
  5. 10.2.x modules/social_features/social_group/src/GroupStatistics.php \Drupal\social_group\GroupStatistics::getGroupMemberCount()

Get group members count.

Parameters

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

Return value

int The number of members.

File

modules/social_features/social_group/src/GroupStatistics.php, line 41

Class

GroupStatistics
Class GroupStatistics.

Namespace

Drupal\social_group

Code

public function getGroupMemberCount(GroupInterface $group) {
  return $this
    ->count($group, 'group_membership');
}