You are here

function social_event_user_delete in Open Social 8.5

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/social_event.module \social_event_user_delete()
  2. 8 modules/social_features/social_event/social_event.module \social_event_user_delete()
  3. 8.2 modules/social_features/social_event/social_event.module \social_event_user_delete()
  4. 8.3 modules/social_features/social_event/social_event.module \social_event_user_delete()
  5. 8.4 modules/social_features/social_event/social_event.module \social_event_user_delete()
  6. 8.6 modules/social_features/social_event/social_event.module \social_event_user_delete()
  7. 8.7 modules/social_features/social_event/social_event.module \social_event_user_delete()
  8. 8.8 modules/social_features/social_event/social_event.module \social_event_user_delete()
  9. 10.3.x modules/social_features/social_event/social_event.module \social_event_user_delete()
  10. 10.0.x modules/social_features/social_event/social_event.module \social_event_user_delete()
  11. 10.1.x modules/social_features/social_event/social_event.module \social_event_user_delete()
  12. 10.2.x modules/social_features/social_event/social_event.module \social_event_user_delete()

Implements hook_ENTITY_TYPE_delete().

File

modules/social_features/social_event/social_event.module, line 300
The Social event module.

Code

function social_event_user_delete(EntityInterface $entity) {
  $storage = \Drupal::entityTypeManager()
    ->getStorage('event_enrollment');
  $entities = $storage
    ->loadByProperties([
    'user_id' => $entity
      ->id(),
  ]);
  $storage
    ->delete($entities);
}