public static function LingotekSync::getTargetChunkCountByStatus in Lingotek Translation 7.6
Same name and namespace in other branches
- 7.7 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getTargetChunkCountByStatus()
- 7.3 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getTargetChunkCountByStatus()
- 7.4 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getTargetChunkCountByStatus()
- 7.5 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getTargetChunkCountByStatus()
File
- lib/
Drupal/ lingotek/ LingotekSync.php, line 421 - LingotekSync
Class
- LingotekSync
- A utility class for Lingotek Syncing.
Code
public static function getTargetChunkCountByStatus($status, $lingotek_locale) {
$target_prefix = 'target_sync_status_';
$target_key = $target_prefix . $lingotek_locale;
$query = db_select('lingotek_config_metadata', 'l')
->fields('l');
$query
->condition('value', $status);
$query
->condition('config_key', $target_key);
$count = 0;
$result = $query
->countQuery()
->execute()
->fetchAssoc();
if (is_array($result)) {
$count = array_shift($result);
}
return $count;
}