You are here

function lingotek_entity_update in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 8 lingotek.module \lingotek_entity_update()
  2. 8.2 lingotek.module \lingotek_entity_update()
  3. 7.7 lingotek.module \lingotek_entity_update()
  4. 7.5 lingotek.module \lingotek_entity_update()
  5. 4.0.x lingotek.module \lingotek_entity_update()
  6. 3.0.x lingotek.module \lingotek_entity_update()
  7. 3.1.x lingotek.module \lingotek_entity_update()
  8. 3.2.x lingotek.module \lingotek_entity_update()
  9. 3.3.x lingotek.module \lingotek_entity_update()
  10. 3.4.x lingotek.module \lingotek_entity_update()
  11. 3.5.x lingotek.module \lingotek_entity_update()
  12. 3.6.x lingotek.module \lingotek_entity_update()
  13. 3.7.x lingotek.module \lingotek_entity_update()
  14. 3.8.x lingotek.module \lingotek_entity_update()

Implements hook_entity_update().

1 call to lingotek_entity_update()
lingotek_entity_insert in ./lingotek.module
Implements hook_entity_insert().

File

./lingotek.module, line 1500

Code

function lingotek_entity_update($entity, $entity_type) {
  $managed_entity_types = array_keys(lingotek_managed_entity_types());
  if (!in_array($entity_type, $managed_entity_types)) {

    // nothing to do here
    return;
  }
  if ($entity_type == 'node' && !empty($entity->tnid) && $entity->nid != $entity->tnid) {

    //check to make sure it is not a target node
    return;
  }
  list($id, $vid, $bundle) = lingotek_entity_extract_ids($entity_type, $entity);
  lingotek_entity_save($entity, $entity_type);
}