function salesforce_api_delete_object_map in Salesforce Suite 7.2
Same name and namespace in other branches
- 6.2 salesforce_api/salesforce_api.module \salesforce_api_delete_object_map()
Given a Drupal entity type and Drupal object id, delete an object mapping
Parameters
string $oid:
string $entity_name:
string $bundle_name (optional):
Return value
int The number of object mappings deleted.
1 call to salesforce_api_delete_object_map()
- sf_entity_entity_delete in sf_entity/
sf_entity.module - Implements hook_entity_delete(). This should be sufficient for implementing node and user deletion as well.
File
- salesforce_api/
salesforce_api.module, line 844 - Defines an API that enables modules to interact with the Salesforce server.
Code
function salesforce_api_delete_object_map($oid, $entity_name, $bundle_name = NULL) {
$num_deleted = db_delete('salesforce_object_map');
if (isset($bundle_name) && !empty($bundle_name)) {
$num_deleted
->condition('drupal_bundle', $bundle_name);
}
$num_deleted
->condition('drupal_entity', $entity_name)
->condition('oid', $oid)
->execute();
return $num_deleted;
}