You are here

function globallink_webform_get_sent_tpt_rows_by_lid_and_target in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.6 globallink_webform/globallink_webform.inc \globallink_webform_get_sent_tpt_rows_by_lid_and_target()

Gets sent webform rows by LID.

Parameters

string $lid: The webform LID.

Return value

array Array of webform rows.

1 call to globallink_webform_get_sent_tpt_rows_by_lid_and_target()
globallink_webform_send_for_translations in globallink_webform/globallink_webform.inc
Sends webforms for translation.

File

globallink_webform/globallink_webform.inc, line 303

Code

function globallink_webform_get_sent_tpt_rows_by_lid_and_target($pid, $lid, $target) {
  $result = db_select('globallink_document', 'gd')
    ->fields('gd')
    ->condition('entity_type', GLOBALLINK_ENTITY_TYPE_WEBFORM, '=')
    ->condition('object_id', $lid, '=')
    ->condition('object_parent_id', $pid, '=')
    ->condition('target_lang_code', $target, '=')
    ->condition('target_status', array(
    GLOBALLINK_STATUS_TRANSLATION_SENT,
    GLOBALLINK_STATUS_TRANSLATION_ERROR,
    GLOBALLINK_STATUS_TRANSLATION_COMPLETED,
  ), 'IN')
    ->execute();
  foreach ($result as $row) {
    return $row;
  }
  return NULL;
}