You are here

public static function LingotekConfigSet::getTargetStatusById in Lingotek Translation 7.6

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

Return the status of the target locale for the given set_id

Parameters

int $set_id: The id of the set to search for

string $target_locale: The lingotek locale to search for

Return value

string The status of the target locale for the given set_id

1 call to LingotekConfigSet::getTargetStatusById()
LingotekSync::getTargetStatus in lib/Drupal/lingotek/LingotekSync.php

File

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

Class

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

Code

public static function getTargetStatusById($set_id, $target_locale) {
  $result = db_select('lingotek_config_metadata', 'meta')
    ->fields('meta', array(
    'value',
  ))
    ->condition('id', $set_id)
    ->condition('config_key', 'target_sync_status_' . $target_locale)
    ->execute();
  if ($result && ($value = $result
    ->fetchField())) {
    return $value;
  }
  LingotekLog::error('Did not find a target status for set ID "@id"', array(
    '@id' => $set_id,
  ));
  return FALSE;
}