You are here

protected static function LingotekConfigSet::getNonLingotekLocalesTargets in Lingotek Translation 7.7

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

Get all locales target entries that were not created by Lingotek

1 call to LingotekConfigSet::getNonLingotekLocalesTargets()
LingotekConfigSet::saveSegmentTranslations in lib/Drupal/lingotek/LingotekConfigSet.php
Save segment target translations for the given language

File

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

Class

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

Code

protected static function getNonLingotekLocalesTargets($document_xml, $target_language) {
  $lids = array(
    -1,
  );

  // seed lids for proper query handling on empty case
  foreach ($document_xml as $drupal_field_name => $xml_obj) {
    $lids[] = self::getLidFromTag($drupal_field_name);
  }
  $result = db_select('locales_target', 'lt')
    ->fields('lt', array(
    'lid',
  ))
    ->condition('lid', $lids, 'IN')
    ->condition('language', $target_language)
    ->condition('translation_agent_id', self::getLingotekTranslationAgentId(), '!=')
    ->execute();
  return $result
    ->fetchCol();
}