You are here

function lingotek_get_current_locales in Lingotek Translation 7.7

1 call to lingotek_get_current_locales()
lingotek_batch_update_entity_languages_by_profile in ./lingotek.batch.inc

File

./lingotek.util.inc, line 2683
Utility functions.

Code

function lingotek_get_current_locales($entity_type, $entity_id) {
  $query = db_select('lingotek_entity_metadata', 'lem')
    ->fields('lem', array(
    'entity_key',
  ))
    ->condition('lem.entity_type', $entity_type)
    ->condition('lem.entity_id', $entity_id)
    ->condition('lem.entity_key', 'target_sync_status_%', 'LIKE');
  $result = $query
    ->execute()
    ->fetchCol();
  $locales = array();
  foreach ($result as $target_str) {
    $locales[] = str_replace('target_sync_status_', '', $target_str);
  }
  return $locales;
}