You are here

public static function LingotekConfigChunk::getDirtyLidsByChunkIdAndLanguage in Lingotek Translation 7.4

Same name and namespace in other branches
  1. 7.3 lib/Drupal/lingotek/LingotekConfigChunk.php \LingotekConfigChunk::getDirtyLidsByChunkIdAndLanguage()
  2. 7.5 lib/Drupal/lingotek/LingotekConfigChunk.php \LingotekConfigChunk::getDirtyLidsByChunkIdAndLanguage()

Return all target segments by ID marked to be updated

This is a preparatory step before resetting the locales targets for a given chunk.

Parameters

int: the ID of the chunk under which to search

string: the language code for which to get the segments that need updating

1 call to LingotekConfigChunk::getDirtyLidsByChunkIdAndLanguage()
LingotekConfigChunk::updateLocalContentByTarget in lib/Drupal/lingotek/LingotekConfigChunk.php
Updates the local content of $target_code with data from a Lingotek Document

File

lib/Drupal/lingotek/LingotekConfigChunk.php, line 721
Defines LingotekConfigChunk.

Class

LingotekConfigChunk
A class wrapper for Lingotek-specific behavior on ConfigChunks.

Code

public static function getDirtyLidsByChunkIdAndLanguage($chunk_id, $language) {
  $result = db_select('locales_target', 'lt')
    ->fields('lt', array(
    'lid',
  ))
    ->condition('lid', self::minLid($chunk_id), '>=')
    ->condition('lid', self::maxLid($chunk_id), '<=')
    ->condition('language', $language)
    ->condition('i18n_status', I18N_STRING_STATUS_CURRENT, '!=')
    ->condition('translation_agent_id', self::getLingotekTranslationAgentId())
    ->execute();
  return $result
    ->fetchCol();
}