You are here

public function MembershipManagerInterface::getGroupIds in Organic groups 8

Returns all group IDs associated with the given group content entity.

Do not use this to retrieve group IDs associated with a user entity. Use MembershipManager::getUserGroups() instead.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The group content entity for which to return the associated groups.

string $group_type_id: Filter results to only include group IDs of this entity type.

string $group_bundle: Filter list to only include group IDs with this bundle.

Return value

array An associative array, keyed by group entity type, each item an array of group entity IDs.

Throws

\InvalidArgumentException Thrown when a user entity is passed in.

See also

\Drupal\og\GroupMembershipInterface::getUserGroups()

1 method overrides MembershipManagerInterface::getGroupIds()
MembershipManager::getGroupIds in src/MembershipManager.php
Returns all group IDs associated with the given group content entity.

File

src/MembershipManagerInterface.php, line 207

Class

MembershipManagerInterface
Membership manager interface.

Namespace

Drupal\og

Code

public function getGroupIds(EntityInterface $entity, $group_type_id = NULL, $group_bundle = NULL);