You are here

function profile_user_delete in Profile 2 8

Implements hook_user_delete().

File

./profile.module, line 137
Support for configurable user profiles.

Code

function profile_user_delete(EntityInterface $entity) {
  $list = entity_load_multiple_by_properties('profile', array(
    'uid' => $entity
      ->id(),
  ));
  foreach ($list as $profile) {
    $profile
      ->delete();
  }
}