You are here

function lingotek_entity_changed in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lingotek.util.inc \lingotek_entity_changed()
  2. 7.6 lingotek.util.inc \lingotek_entity_changed()
2 calls to lingotek_entity_changed()
lingotek_entity_save in ./lingotek.module
lingotek_rules_entity_upload in ./lingotek.rules.inc

File

./lingotek.util.inc, line 1810
Utility functions.

Code

function lingotek_entity_changed($entity_type, $entity, $entity_id) {
  $updated_entity = $entity;
  if ($entity_type == 'node') {
    $updated_entity = lingotek_node_load_default($entity_id);
  }
  $xml = lingotek_entity_xml_body($entity_type, $updated_entity);
  $hash = md5($xml);
  $oldhash = lingotek_keystore($entity_type, $entity_id, 'hash');
  if (!$oldhash || strcmp($hash, $oldhash)) {
    lingotek_keystore($entity_type, $entity_id, 'hash', $hash);
    return TRUE;
  }
  return FALSE;
}