public function MembershipManagerInterface::getMemberships in Organic groups 8
Returns the group memberships a user is associated with.
Parameters
int $user_id: The ID of the user to get group memberships for.
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\og\OgMembershipInterface[] An array of OgMembership entities, keyed by ID.
1 method overrides MembershipManagerInterface::getMemberships()
- MembershipManager::getMemberships in src/
MembershipManager.php - Returns the group memberships a user is associated with.
File
- src/
MembershipManagerInterface.php, line 113
Class
- MembershipManagerInterface
- Membership manager interface.
Namespace
Drupal\ogCode
public function getMemberships($user_id, array $states = [
OgMembershipInterface::STATE_ACTIVE,
]);