You are here

public function MembershipManagerInterface::getGroupMembershipsByRoleNames in Organic groups 8

Returns the memberships of the given group filtered by role name.

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 memberships, pass `[OgRoleInterface::AUTHENTICATED]`.

array $states: (optional) Array with the states to return. Defaults to only returning active memberships. In order to retrieve all memberships regardless of state, pass `OgMembershipInterface::ALL_STATES`.

Return value

\Drupal\Core\Entity\EntityInterface[] The membership entities.

1 method overrides MembershipManagerInterface::getGroupMembershipsByRoleNames()
MembershipManager::getGroupMembershipsByRoleNames in src/MembershipManager.php
Returns the memberships of the given group filtered by role name.

File

src/MembershipManagerInterface.php, line 167

Class

MembershipManagerInterface
Membership manager interface.

Namespace

Drupal\og

Code

public function getGroupMembershipsByRoleNames(EntityInterface $group, array $role_names, array $states = [
  OgMembershipInterface::STATE_ACTIVE,
]);