You are here

public static function LingotekConfigSet::findNeverUploadedLids in Lingotek Translation 7.7

Check a given list for lids that have never been uploaded

Parameters

type $control_list: The list of lids to search through

Return value

type

1 call to LingotekConfigSet::findNeverUploadedLids()
config_upload_edited in ./lingotek.bulk_grid.inc

File

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

Class

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

Code

public static function findNeverUploadedLids($control_list = NULL) {
  if ($control_list !== NULL && !empty($control_list)) {
    $query = db_select('locales_source', 'ls');
    $query
      ->leftJoin('locales_target', 'lt', 'ls.lid = lt.lid');
    $query
      ->isNull("lt.lid");
    $query
      ->addField('ls', 'lid');
    $query
      ->addField('ls', "textgroup");
    $query
      ->condition('ls.lid', $control_list, 'IN');
    $never_uploaded_lids = $query
      ->execute();
    $textgroup_lid = array();
    foreach ($never_uploaded_lids as $lid) {
      $textgroup_lid[$lid->textgroup][$lid->lid] = $lid->lid;
    }
    return $textgroup_lid;
  }
  return array();
}