function hook_entity_delete


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 system.api.php hook_entity_delete($entity, $type)
cle7 system.api.php hook_entity_delete($entity, $type)
elmsmedia7 system.api.php hook_entity_delete($entity, $type)
icor7 system.api.php hook_entity_delete($entity, $type)
meedjum_blog7 system.api.php hook_entity_delete($entity, $type)
mooc7 system.api.php hook_entity_delete($entity, $type)

Act on entities when deleted.


$entity: The entity object.

$type: The type of entity being deleted (i.e. node, user, comment).

Related topics

9 functions implement hook_entity_delete()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

display_cache_entity_delete in sites/all/modules/ulmus/display_cache/display_cache.module
Implements hook_entity_delete().
entitycache_entity_delete in sites/all/modules/ulmus/entitycache/entitycache.module
Implements hook_entity_delete().
entityreference_entity_delete in sites/all/modules/ulmus/entityreference/entityreference.module
Implements hook_entity_delete().
entity_crud_hook_test_entity_delete in modules/simpletest/tests/entity_crud_hook_test.module
Implements hook_entity_delete().
entity_test_entity_delete in sites/all/modules/ulmus/entity/tests/entity_test.module
Implements hook_entity_delete().

... See full list

16 invocations of hook_entity_delete()
comment_delete_multiple in modules/comment/comment.module
Delete comments and all their replies.
EntityAPIController::delete in sites/all/modules/ulmus/entity/includes/
Implements EntityAPIControllerInterface.
field_attach_delete in modules/field/
Delete field data for an existing entity. This deletes all revisions of field data for the entity.
field_purge_data in modules/field/
Purges the field data for a single field on a single pseudo-entity.
file_delete in includes/
Deletes a file and its database record.

... See full list


modules/system/system.api.php, line 371
Hooks provided by Drupal core and the System module.


function hook_entity_delete($entity, $type) {
  // Delete the entity's entry from a fictional table of all entities.
  $info = entity_get_info($type);
  list($id) = entity_extract_ids($type, $entity);
  db_delete('example_entity')->condition('type', $type)->condition('id', $id)->execute();



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.