You are here

function globallink_entity_get_row_by_nid_and_locale in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.5 globallink_entity/globallink_entity.inc \globallink_entity_get_row_by_nid_and_locale()

Gets entity row by node ID and locale.

Parameters

string $nid: The node ID.

string $source: The source of the entity.

string $target: The target of the entity.

Return value

The entity row if all goes well. FALSE if it fails.

2 calls to globallink_entity_get_row_by_nid_and_locale()
globallink_entity_update_status in globallink_entity/globallink_entity.inc
Updates entity status.
globallink_entity_update_ticket_id in globallink_entity/globallink_entity.inc
Updates entity ticket ID.

File

globallink_entity/globallink_entity.inc, line 190

Code

function globallink_entity_get_row_by_nid_and_locale($nid, $source, $target) {
  $result = db_select('globallink_core_entity', 'tc')
    ->fields('tc')
    ->condition('nid', $nid, '=')
    ->condition('source', $source, '=')
    ->condition('target', $target, '=')
    ->execute();
  foreach ($result as $row) {
    return $row;
  }
  return FALSE;
}