You are here

function _sf_entity_export_termreference in Salesforce Suite 7.2

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

File

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

Code

function _sf_entity_export_termreference($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 ($tid = $entity->{$fieldname}[$lang][0]['tid']) {
    $sf_data = salesforce_api_id_load($tid, 'taxonomy_term');
    $sfid = isset($sf_data->sfid) ? $sf_data->sfid : '';
  }
  return $sfid;
}