function hook_entity_update

7.x system.api.php hook_entity_update($entity, $type)

Act on entities when updated.


$entity: The entity object.

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

Related topics

1 function implements hook_entity_update()

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

entity_crud_hook_test_entity_update in drupal/modules/simpletest/tests/entity_crud_hook_test.module
Implements hook_entity_update().
7 invocations of hook_entity_update()
comment_save in drupal/modules/comment/comment.module
Accepts a submission of new or changed comment content.
field_attach_update in drupal/modules/field/
Save field data for an existing entity.
file_save in drupal/includes/
Saves a file object to the database.
taxonomy_vocabulary_save in drupal/modules/taxonomy/taxonomy.module
Saves a vocabulary.
update_check_requirements in drupal/update.php
Checks update requirements and reports errors and (optionally) warnings.

... See full list


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


function hook_entity_update($entity, $type) {
  // Update the entity's entry in a fictional table of all entities.
  $info = entity_get_info($type);
  list($id) = entity_extract_ids($type, $entity);
    'updated' => REQUEST_TIME,
  ))->condition('type', $type)->condition('id', $id)->execute();