You are here

function epub_entity_delete in Epub 8

Implements hook_entity_delete().

File

./epub.module, line 55

Code

function epub_entity_delete(Drupal\Core\Entity\EntityInterface $entity) {
  if ($entity
    ->getEntityTypeId() == 'file') {
    $destination = 'public://epub_content/' . $entity
      ->id();
    file_unmanaged_delete_recursive($destination);
  }
}