You are here

public static function LingotekSync::getAllLocalDocIds in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getAllLocalDocIds()
  2. 7.4 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getAllLocalDocIds()
  3. 7.5 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getAllLocalDocIds()
  4. 7.6 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getAllLocalDocIds()
1 call to LingotekSync::getAllLocalDocIds()
lingotek_batch_reset_content in ./lingotek.batch.inc
Batch Create: Lingotek Reset Content

File

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

Class

LingotekSync
A utility class for Lingotek Syncing.

Code

public static function getAllLocalDocIds() {

  // node-related doc IDs
  $query = db_select('lingotek', 'l');
  $query
    ->fields('l', array(
    'lingovalue',
  ));
  $query
    ->condition('lingokey', 'document_id');
  $query
    ->distinct();
  $result = $query
    ->execute();
  $doc_ids = $result
    ->fetchCol();

  // entity-related doc IDs
  $query = db_select('lingotek_entity_metadata', 'l');
  $query
    ->fields('l', array(
    'value',
  ));
  $query
    ->condition('entity_key', 'document_id');
  $query
    ->distinct();
  $result = $query
    ->execute();
  $doc_ids = array_merge($doc_ids, $result
    ->fetchCol());

  // config-related doc IDs
  $query = db_select('lingotek_config_metadata', 'l')
    ->fields('l', array(
    'value',
  ))
    ->condition('config_key', 'document_id')
    ->distinct();
  $result = $query
    ->execute();
  $doc_ids = array_merge($doc_ids, $result
    ->fetchCol());
  return $doc_ids;
}