function salesforce_api_id_unlink in Salesforce Suite 7.2
Same name and namespace in other branches
- 6.2 salesforce_api/salesforce_api.module \salesforce_api_id_unlink()
3 calls to salesforce_api_id_unlink()
- 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_salesforce_form in sf_entity/
sf_entity.module - Displays the Salesforce synchronization form.
- sf_entity_salesforce_form_submit in sf_entity/
sf_entity.module - Form submit handler for the [entity-name]/%/salesforce form.
File
- salesforce_api/
salesforce_api.module, line 1430 - Defines an API that enables modules to interact with the Salesforce server.
Code
function salesforce_api_id_unlink($args) {
$valid_args = !empty($args['sfid']) || !empty($args['oid']) && (!empty($args['drupal_entity']) || !empty($args['name']));
if (!$valid_args) {
return FALSE;
}
$num_deleted = db_delete('salesforce_object_map');
if (!empty($args['oid'])) {
$num_deleted
->condition('oid', $args['oid']);
}
if (!empty($args['sfid'])) {
$num_deleted
->condition('sfid', $args['sfid']);
}
if (!empty($args['drupal_entity'])) {
$num_deleted
->condition('drupal_entity', $args['drupal_entity']);
}
if (!empty($args['name'])) {
$num_deleted
->condition('name', $args['name']);
}
$num_deleted
->execute();
module_invoke_all('salesforce_api_post_unlink', $args);
}