public function MembershipManagerInterface::getGroupMembershipIdsByRoleNames in Organic groups 8
Returns the membership IDs of the given group filtered by role names.
Parameters
\Drupal\Core\Entity\EntityInterface $group: The group entity for which to return the memberships.
array $role_names: An array of role names to filter by. In order to retrieve a list of all membership IDs, pass `[OgRoleInterface::AUTHENTICATED]`.
array $states: (optional) Array with the states to return. Defaults to only returning active membership IDs. In order to retrieve all membership IDs regardless of state, pass `OgMembershipInterface::ALL_STATES`.
Return value
\Drupal\Core\Entity\EntityInterface[] The membership entities.
1 method overrides MembershipManagerInterface::getGroupMembershipIdsByRoleNames()
- MembershipManager::getGroupMembershipIdsByRoleNames in src/
MembershipManager.php - Returns the membership IDs of the given group filtered by role names.
File
- src/
MembershipManagerInterface.php, line 149
Class
- MembershipManagerInterface
- Membership manager interface.
Namespace
Drupal\ogCode
public function getGroupMembershipIdsByRoleNames(EntityInterface $group, array $role_names, array $states = [
OgMembershipInterface::STATE_ACTIVE,
]);