You are here

function globallink_update_change_detection_entity in GlobalLink Connect for Drupal 7.5

Same name and namespace in other branches
  1. 7.7 globallink_entity/globallink_entity.module \globallink_update_change_detection_entity()
  2. 7.6 globallink_entity/globallink_entity.module \globallink_update_change_detection_entity()

Updates change detection entity with new node ID and language.

Parameters

object $node: The node object.

string $lang: The target language.

1 call to globallink_update_change_detection_entity()
globallink_entity_node_presave in globallink_entity/globallink_entity.module
Implements hook_node_presave().

File

globallink_entity/globallink_entity.module, line 157
GlobalLink entity translation module.

Code

function globallink_update_change_detection_entity($node, $lang) {
  module_load_include('inc', 'globallink', 'globallink');
  $tpt_locale_code = globallink_get_locale_code($lang);
  db_update('globallink_core_entity')
    ->fields(array(
    'last_modified' => REQUEST_TIME,
    'changed' => 1,
  ))
    ->condition('nid', $node->nid, '=')
    ->condition('source', $tpt_locale_code, '=')
    ->execute();
}