You are here

function globallink_get_sent_rows_by_nid in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.5 globallink.inc \globallink_get_sent_rows_by_nid()
  2. 7.6 globallink.inc \globallink_get_sent_rows_by_nid()

Gets sent TPT rows by node id.

Parameters

int $nid: The node id.

Return value

array Array of TPT rows.

1 call to globallink_get_sent_rows_by_nid()
globallink_send_for_translations in ./globallink_node.inc

File

./globallink.inc, line 311
Miscellaneous GlobalLink functions for node translations (non-entity).

Code

function globallink_get_sent_rows_by_nid($nid) {
  $result = db_select('globallink_document', 'gd')
    ->fields('gd')
    ->condition('entity_type', GLOBALLINK_ENTITY_TYPE_NODE, '=')
    ->condition('object_id', $nid, '=')
    ->condition('target_status', array(
    GLOBALLINK_STATUS_TRANSLATION_SENT,
    GLOBALLINK_STATUS_TRANSLATION_COMPLETED,
    GLOBALLINK_STATUS_TRANSLATION_ERROR,
  ), 'IN')
    ->execute();
  $rows = array();
  foreach ($result as $row) {
    $rows[] = $row;
  }
  return $rows;
}