public function MembershipManagerInterface::getGroupCount in Organic groups 8
Returns the number of groups associated with a given group content entity.
Do not use this to retrieve the group membership count for a user entity. Use count(\Drupal\og\MembershipManager::getUserGroupIds()) instead.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The group content entity for which to count the associated groups.
string $group_type_id: Only count groups of this entity type.
string $group_bundle: Only count groups of this bundle.
Return value
int The number of associated groups.
1 method overrides MembershipManagerInterface::getGroupCount()
- MembershipManager::getGroupCount in src/
MembershipManager.php - Returns the number of groups associated with a given group content entity.
File
- src/
MembershipManagerInterface.php, line 251
Class
- MembershipManagerInterface
- Membership manager interface.
Namespace
Drupal\ogCode
public function getGroupCount(EntityInterface $entity, $group_type_id = NULL, $group_bundle = NULL);