public function MembershipManagerInterface::isMember in Organic groups 8
Returns whether a user belongs to a group.
Parameters
\Drupal\Core\Entity\EntityInterface $group: The group entity.
int $user_id: The ID of the user to test the membership for.
array $states: (optional) Array with the membership states to check the membership. Defaults to active memberships.
Return value
bool TRUE if the entity (e.g. the user or node) belongs to a group with a certain state.
1 method overrides MembershipManagerInterface::isMember()
- MembershipManager::isMember in src/
MembershipManager.php - Returns whether a user belongs to a group.
File
- src/
MembershipManagerInterface.php, line 287
Class
- MembershipManagerInterface
- Membership manager interface.
Namespace
Drupal\ogCode
public function isMember(EntityInterface $group, $user_id, array $states = [
OgMembershipInterface::STATE_ACTIVE,
]);