You are here

function get_tpt_entity_sent_rows in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.7 globallink_entity/globallink_entity.module \get_tpt_entity_sent_rows()
  2. 7.5 globallink_entity/globallink_entity.module \get_tpt_entity_sent_rows()

Gets entity rows that have been sent for translation.

Parameters

string $nid: The entity node ID.

string $source: The target language of the entity.

Return value

array Array of entity rows that have been sent for translation.

File

globallink_entity/globallink_entity.module, line 182
GlobalLink entity translation module.

Code

function get_tpt_entity_sent_rows($nid, $source) {
  module_load_include('inc', 'globallink', 'globallink');
  $arr = array();
  $query = db_select('globallink_core_entity', 'tc')
    ->fields('tc')
    ->condition('nid', $nid, '=')
    ->condition('status', array(
    'Sent for Translations',
    'Error',
    'Cancelled',
  ), 'IN')
    ->condition('source', globallink_get_locale_code($source), '=');
  $result = $query
    ->execute();
  foreach ($result as $row) {
    $arr[] = globallink_get_drupal_locale_code($row->target);
  }
  return $arr;
}