You are here

public static function LingotekSync::getNodeIdsByStatus in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.3 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getNodeIdsByStatus()
  2. 7.4 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getNodeIdsByStatus()
  3. 7.5 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getNodeIdsByStatus()
  4. 7.6 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getNodeIdsByStatus()

File

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

Class

LingotekSync
A utility class for Lingotek Syncing.

Code

public static function getNodeIdsByStatus($status, $source) {
  $query = db_select('lingotek_entity_metadata', 'l');
  $query
    ->condition('entity_type', 'node');
  $query
    ->addField('l', 'entity_id', 'nid');
  if ($source) {
    $query
      ->condition('entity_key', 'upload_status');
  }
  else {
    $query
      ->condition('entity_key', 'target_sync_status_%', 'LIKE');
  }
  $query
    ->condition('value', $status);
  $query
    ->distinct();
  $result = $query
    ->execute();
  $nids = $result
    ->fetchCol();
  return $nids;
}