You are here

function group_user_leave in Group 7

Leave a group.

Parameters

Group $group: The group to leave.

object $account: The user that wants to leave.

GroupMembership $group_membership: The group membership of the user that wants to leave.

1 string reference to 'group_user_leave'
group_group_membership_action_info in ./group.group.inc
Implements hook_group_membership_action_info().

File

./group.group.inc, line 522
Hook implementations for the Group module.

Code

function group_user_leave(Group $group, $account, GroupMembership $group_membership) {
  $group_membership
    ->delete();
  drupal_set_message(t('You have left the group.'));
}