You are here

function entity_modified_entity_update in Entity modified 7

Implements hook_entity_update().

2 calls to entity_modified_entity_update()
entity_modified_entity_insert in ./entity_modified.module
Implements hook_entity_insert().
entity_modified_nodequeue_update_modified in modules/entity_modified_nodequeue/entity_modified_nodequeue.module
Update NQ information for a fake entity type; also update the node.

File

./entity_modified.module, line 35
Hook implementations and frequently used functions for entity modified module.

Code

function entity_modified_entity_update($entity, $type) {

  // If the module does not have a modified property that we know about then
  // insert or update.
  if (!entity_modified_property_name($type)) {
    list($entity_id) = entity_extract_ids($type, $entity);
    db_merge('entity_modified')
      ->key(array(
      'entity_type' => $type,
      'entity_id' => $entity_id,
    ))
      ->fields(array(
      'entity_type' => $type,
      'entity_id' => $entity_id,
      'modified' => REQUEST_TIME,
    ))
      ->execute();
  }
}