You are here

public function GroupStatistics::getGroupNodeCount in Open Social 10.2.x

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

Get group node count by type.

Parameters

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

string $type: Node type id.

Return value

int The number of nodes.

File

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

Class

GroupStatistics
Class GroupStatistics.

Namespace

Drupal\social_group

Code

public function getGroupNodeCount(GroupInterface $group, $type) {
  return $this
    ->count($group, 'group_node-' . $type);
}