X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fhook%2Fentity_delete.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fhook%2Fentity_delete.twig;h=e8f3ddfe7ecd9c0dd5040d038a38c85dfa5a5749;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=0000000000000000000000000000000000000000;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_delete.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_delete.twig new file mode 100644 index 000000000..e8f3ddfe7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_delete.twig @@ -0,0 +1,10 @@ +/** + * Implements hook_entity_delete(). + */ +function {{ machine_name }}_entity_delete(Drupal\Core\Entity\EntityInterface $entity) { + // Delete the entity's entry from a fictional table of all entities. + db_delete('example_entity') + ->condition('type', $entity->getEntityTypeId()) + ->condition('id', $entity->id()) + ->execute(); +}