You are here

public static function LingotekSync::getDocIdFromEntityId in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.5 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getDocIdFromEntityId()
  2. 7.6 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getDocIdFromEntityId()
1 call to LingotekSync::getDocIdFromEntityId()
lingotek_sync_target_locales in ./lingotek.module

File

lib/Drupal/lingotek/LingotekSync.php, line 1189
LingotekSync

Class

LingotekSync
A utility class for Lingotek Syncing.

Code

public static function getDocIdFromEntityId($entity_type, $entity_id) {
  $found = FALSE;
  $query = db_select('lingotek_entity_metadata', 'l')
    ->fields('l');
  $query
    ->condition('entity_type', $entity_type);
  $query
    ->condition('entity_id', $entity_id);
  $query
    ->condition('entity_key', 'document_id');
  $result = $query
    ->execute();
  if ($record = $result
    ->fetchAssoc()) {
    $found = $record['value'];
  }
  return $found;
}