You are here

public function Group::getMember in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/Group.php \Drupal\group\Entity\Group::getMember()

Retrieves a user's membership for the group.

Parameters

\Drupal\Core\Session\AccountInterface $account: The user to load the membership for.

Return value

\Drupal\group\GroupMembership|false The loaded GroupMembership or FALSE if none was found.

Overrides GroupInterface::getMember

2 calls to Group::getMember()
Group::addMember in src/Entity/Group.php
Adds a user as a member of the group.
Group::removeMember in src/Entity/Group.php
Removes a user as a member from the group.

File

src/Entity/Group.php, line 208

Class

Group
Defines the Group entity.

Namespace

Drupal\group\Entity

Code

public function getMember(AccountInterface $account) {
  return $this
    ->membershipLoader()
    ->load($this, $account);
}