You are here

function globallink_block_get_sent_tpt_rows_by_bid in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.5 globallink_block/globallink_block.inc \globallink_block_get_sent_tpt_rows_by_bid()
  2. 7.6 globallink_block/globallink_block.inc \globallink_block_get_sent_tpt_rows_by_bid()

Gets sent block rows by ID.

Parameters

string $bid: The block ID.

Return value

array Array of block rows.

1 call to globallink_block_get_sent_tpt_rows_by_bid()
globallink_block_send_blocks_for_translations in globallink_block/globallink_block.inc
Sends blocks for translation.

File

globallink_block/globallink_block.inc, line 344

Code

function globallink_block_get_sent_tpt_rows_by_bid($bid) {
  $result = db_select('globallink_document', 'gd')
    ->fields('gd')
    ->condition('entity_type', GLOBALLINK_ENTITY_TYPE_BLOCK, '=')
    ->condition('object_id', $bid, '=')
    ->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;
}