function hook_ENTITY_TYPE_update

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/entity.api.php \hook_ENTITY_TYPE_update()
  2. 10 core/lib/Drupal/Core/Entity/entity.api.php \hook_ENTITY_TYPE_update()
  3. 11.x core/lib/Drupal/Core/Entity/entity.api.php \hook_ENTITY_TYPE_update()

Respond to updates to an entity of a particular type.

This hook runs once the entity storage has been updated. Note that hook implementations may not alter the stored entity data. Get the original entity object from $entity->original.


\Drupal\Core\Entity\EntityInterface $entity: The entity object.

See also


Related topics


core/lib/Drupal/Core/Entity/entity.api.php, line 1252


function hook_ENTITY_TYPE_update(\Drupal\Core\Entity\EntityInterface $entity) {
    // Update the entity's entry in a fictional table of this type of entity.
        'updated' => REQUEST_TIME,
        ->condition('id', $entity->id())

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.