function salesforce_api_id_save in Salesforce Suite 7
Same name and namespace in other branches
- 5.2 salesforce_api/salesforce_api.module \salesforce_api_id_save()
- 6.2 salesforce_api/salesforce_api.module \salesforce_api_id_save()
- 7.2 salesforce_api/salesforce_api.module \salesforce_api_id_save()
Saves the Salesforce ID and fieldmap index of a Drupal object.
Parameters
$entity: The entity you are saving; e.g. node or user.
$bundle: The bundle you are saving for; e.g. node type or vocab name
$oid: The associated unique ID used to identify the object in Drupal.
$sfid: The Salesforce ID of the associated object in the Salesforce database.
$fieldmap: The index of the fieldmap used to generate the export.
2 calls to salesforce_api_id_save()
- sf_entity_export in sf_entity/
sf_entity.module - Exports an entity to Salesforce using the specified fieldmap and stores the ID of the Salesforce object for the entity.
- sf_entity_import in sf_entity/
sf_entity.module - Imports data from Salesforce into an entity
File
- salesforce_api/
salesforce_api.module, line 814 - Defines an API that enables modules to interact with the Salesforce server.
Code
function salesforce_api_id_save($entity, $bundle, $oid, $sfid, $fieldmap) {
db_delete('salesforce_object_map')
->condition('drupal_entity', $entity)
->condition('drupal_bundle', $bundle)
->condition('oid', $oid)
->execute();
db_insert('salesforce_object_map')
->fields(array(
'drupal_entity' => $entity,
'drupal_bundle' => $bundle,
'oid' => $oid,
'sfid' => $sfid,
'fieldmap' => $fieldmap,
))
->execute();
}