hook_entity_delete(Drupal\Core\Entity\EntityInterface $entity)
Respond to entity deletion.
This hook runs once the entity has been deleted from the storage.
\Drupal\Core\Entity\EntityInterface $entity: The entity object for the entity that has been deleted.
function hook_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(); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!entity.api.php/function/hook_entity_delete/8.1.x