You are here

public static function LingotekSync::getSyncProjects in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getSyncProjects()
  2. 7.3 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getSyncProjects()
  3. 7.4 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getSyncProjects()
  4. 7.6 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getSyncProjects()
1 call to LingotekSync::getSyncProjects()
lingotek_set_target_language in ./lingotek.util.inc
Sets the extended target language locale in the languages table and whether or not it is enabled

File

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

Class

LingotekSync
A utility class for Lingotek Syncing.

Code

public static function getSyncProjects() {
  $query = db_select('{lingotek_entity_metadata}', 'l');
  $query
    ->fields('l', array(
    'value',
  ));
  $query
    ->condition('entity_type', 'node');
  $query
    ->condition('entity_key', 'project_id');
  $query
    ->distinct();
  $result = $query
    ->execute();
  $projects = $result
    ->fetchCol();
  $default_project_id = variable_get('lingotek_project', NULL);
  if (!is_null($default_project_id) && !in_array($default_project_id, $projects)) {
    $projects[] = $default_project_id;
  }
  return $projects;
}