You are here

protected function MembershipManager::loadMemberships in Organic groups 8

Returns the full membership entities with the given memberships IDs.

Parameters

array $ids: The IDs of the memberships to load.

Return value

\Drupal\og\OgMembershipInterface[] The membership entities.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException Thrown when the entity type definition of one or more of the passed in entity types is invalid.

\Drupal\Component\Plugin\Exception\PluginNotFoundException Thrown when one or more of the passed in entity types is not defined.

2 calls to MembershipManager::loadMemberships()
MembershipManager::getGroupMembershipsByRoleNames in src/MembershipManager.php
Returns the memberships of the given group filtered by role name.
MembershipManager::getMemberships in src/MembershipManager.php
Returns the group memberships a user is associated with.

File

src/MembershipManager.php, line 531

Class

MembershipManager
Service for managing memberships and group content.

Namespace

Drupal\og

Code

protected function loadMemberships(array $ids) {
  if (empty($ids)) {
    return [];
  }
  return $this->entityTypeManager
    ->getStorage('og_membership')
    ->loadMultiple($ids);
}