X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fhook%2Fentity_revision_delete.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fhook%2Fentity_revision_delete.twig;h=c0c8978a40956e72b59dd6f1c222568f76994cb0;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_revision_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_revision_delete.twig new file mode 100644 index 000000000..c0c8978a4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_revision_delete.twig @@ -0,0 +1,9 @@ +/** + * Implements hook_entity_revision_delete(). + */ +function {{ machine_name }}_entity_revision_delete(Drupal\Core\Entity\EntityInterface $entity) { + $referenced_files_by_field = _editor_get_file_uuids_by_field($entity); + foreach ($referenced_files_by_field as $field => $uuids) { + _editor_delete_file_usage($uuids, $entity, 1); + } +}