Chris@0: /** Chris@0: * Implements hook_entity_update(). Chris@0: */ Chris@0: function {{ machine_name }}_entity_update($entity, $type) { Chris@0: // Update the entity's entry in a fictional table of all entities. Chris@0: $info = entity_get_info($type); Chris@0: list($id) = entity_extract_ids($type, $entity); Chris@0: db_update('example_entity') Chris@0: ->fields(array( Chris@0: 'updated' => REQUEST_TIME, Chris@0: )) Chris@0: ->condition('type', $type) Chris@0: ->condition('id', $id) Chris@0: ->execute(); Chris@0: }