function translation_entity_entity_delete

Implements hook_entity_delete().

1 call to translation_entity_entity_delete()
translation_entity_entity_update in drupal/core/modules/translation_entity/translation_entity.module
Implements hook_entity_update().

File

drupal/core/modules/translation_entity/translation_entity.module, line 527
Allows entities to be translated into different languages.

Code

function translation_entity_entity_delete(EntityInterface $entity) {

  // Only do something if translation support for the given entity is enabled.
  if (!translation_entity_enabled($entity
    ->entityType(), $entity
    ->bundle())) {
    return;
  }
  db_delete('translation_entity')
    ->condition('entity_type', $entity
    ->entityType())
    ->condition('entity_id', $entity
    ->id())
    ->execute();
}