You are here

function globallink_get_nid in GlobalLink Connect for Drupal 7.7

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

Checks for existence of node id object.

Parameters

object $globallink: The GlobalLink object.

Return value

True if the node exists.

File

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

Code

function globallink_get_nid(&$globallink) {
  $translated_arr = globallink_get_content_attributes_from_xml($globallink->targetXML);
  if (count($translated_arr) > 0) {
    $globallink->nid = isset($translated_arr['nid']) ? $translated_arr['nid'] : 0;
    $globallink->tptRowId = isset($translated_arr['rid']) ? $translated_arr['rid'] : 0;
    return TRUE;
  }
  return FALSE;
}