You are here

function _sf_entity_export_nodereference in Salesforce Suite 7.2

1 string reference to '_sf_entity_export_nodereference'
sf_entity_fieldmap_objects in sf_entity/sf_entity.module

File

sf_entity/sf_entity.module, line 1400
Integrates fieldable entities with the Salesforce API.

Code

function _sf_entity_export_nodereference($entity, $fieldkey, $drupal_field_definition, $sf_field_definition) {
  $lang = _sf_entity_get_language($entity);
  $sfid = '';

  // Get the data array for the field.
  list($fieldname, $column) = explode(':', $fieldkey, 2);
  if ($nid = $entity->{$fieldname}[$lang][0]['nid']) {
    $sf_data = salesforce_api_id_load($nid, 'node');
    $sfid = isset($sf_data->sfid) ? $sf_data->sfid : '';
  }
  return $sfid;
}