Overrides Drupal\Core\Entity\DatabaseStorageController::preDelete().
Overrides DatabaseStorageController::preDelete
public function preDelete($entities) {
foreach ($entities as $entity) {
// Delete the actual file. Failures due to invalid files and files that
// were already deleted are logged to watchdog but ignored, the
// corresponding file entity will be deleted.
file_unmanaged_delete($entity->uri);
}
// Delete corresponding file usage entries.
db_delete('file_usage')
->condition('fid', array_keys($entities), 'IN')
->execute();
}