You are here

public function OgMembership::revokeRole in Organic groups 8

Revokes a role from the OG membership.

Parameters

\Drupal\og\OgRoleInterface $role: The OG role.

Return value

\Drupal\og\OgMembershipInterface The updated OG Membership object.

Overrides OgMembershipInterface::revokeRole

1 call to OgMembership::revokeRole()
OgMembership::preSave in src/Entity/OgMembership.php
Acts on an entity before the presave hook is invoked.

File

src/Entity/OgMembership.php, line 240

Class

OgMembership
The membership entity that connects a group and a user.

Namespace

Drupal\og\Entity

Code

public function revokeRole(OgRoleInterface $role) : OgMembershipInterface {
  return $this
    ->revokeRoleById($role
    ->id());
}