You are here

function flag_entity_predelete in Flag 8.4

File

./flag.module, line 521
The Flag module.

Code

function flag_entity_predelete(EntityInterface $entity) {

  // User flags handle things through user entity hooks.
  if ($entity
    ->getEntityTypeId() == 'user') {
    return;
  }
  \Drupal::service('flag')
    ->unflagAllByEntity($entity);
}