You are here

public static function LingotekConfigSet::getIdByDocId in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.6 lib/Drupal/lingotek/LingotekConfigSet.php \LingotekConfigSet::getIdByDocId()

Return the set ID for a given Lingotek document ID, if it exists

Parameters

int: the id of a lingotek document

Return value

int the ID of a set of configuration segments

2 calls to LingotekConfigSet::getIdByDocId()
LingotekSync::getTargetStatus in lib/Drupal/lingotek/LingotekSync.php
lingotek_get_sync_download_batch_elements in ./lingotek.batch.inc
Sync - Download Batch Elements: Creates the batch elements for nodes/documents that need to be downloaded.

File

lib/Drupal/lingotek/LingotekConfigSet.php, line 420
Defines LingotekConfigSet.

Class

LingotekConfigSet
A class wrapper for Lingotek-specific behavior on ConfigSets.

Code

public static function getIdByDocId($doc_id) {
  $query = db_select('lingotek_config_metadata', 'meta');
  $query
    ->fields('meta', array(
    'id',
  ));
  $query
    ->condition('config_key', 'document_id');
  $query
    ->condition('value', $doc_id);
  $set_id = $query
    ->execute()
    ->fetchField();
  if ($set_id !== FALSE) {
    return $set_id;
  }
  return FALSE;
}