You are here

function gprofile_group_membership_delete in Group 7

Implements hook_group_membership_delete().

File

modules/gprofile/gprofile.entity.inc, line 220
Contains all Entity API functions for the Group member profiles module.

Code

function gprofile_group_membership_delete(GroupMembership $group_membership) {

  // Do not use the 'profiles' property here because we want to make sure the
  // list of member profiles wasn't manipulated before delete them all.
  foreach (gprofile_load_by_member($group_membership->mid) as $gprofile) {
    $gprofile
      ->delete();
  }
}