public function GroupMembershipLoaderInterface::loadByUser in Group 8
Same name and namespace in other branches
- 2.0.x src/GroupMembershipLoaderInterface.php \Drupal\group\GroupMembershipLoaderInterface::loadByUser()
Loads all memberships for a user.
Parameters
\Drupal\Core\Session\AccountInterface $account: (optional) The user to load the membership for. Leave blank to load the memberships of the currently logged in user.
string|array $roles: (optional) A group role machine name or a list of group role machine names to filter on. Valid results only need to match on one role.
Return value
\Drupal\group\GroupMembership[] The loaded GroupMemberships matching the criteria.
1 method overrides GroupMembershipLoaderInterface::loadByUser()
- GroupMembershipLoader::loadByUser in src/
GroupMembershipLoader.php - Loads all memberships for a user.
File
- src/
GroupMembershipLoaderInterface.php, line 53
Class
- GroupMembershipLoaderInterface
- Defines the group membership loader interface.
Namespace
Drupal\groupCode
public function loadByUser(AccountInterface $account = NULL, $roles = NULL);