You are here

function profile_user_delete in Profile 8

Implements hook_user_delete().

File

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

Code

function profile_user_delete(EntityInterface $entity) {
  $list = \Drupal::entityTypeManager()
    ->getStorage('profile')
    ->loadByProperties([
    'uid' => $entity
      ->id(),
  ]);
  foreach ($list as $profile) {
    $profile
      ->delete();
  }
}