function hook_salesforce_push_entity_allowed in Salesforce Suite 7.3
Same name and namespace in other branches
- 8.4 salesforce.api.php \hook_salesforce_push_entity_allowed()
- 8.3 salesforce.api.php \hook_salesforce_push_entity_allowed()
- 5.0.x salesforce.api.php \hook_salesforce_push_entity_allowed()
Prevent push to SF for an entity for a given mapping. For example: mapping a single Drupal object to multiple separate Salesforce objects, but only syncing under certain conditions.
Parameters
string $entity_type: The type of entity the push is for.
object $entity: The entity object the push is for.
int $sf_sync_trigger: Constant for the Drupal operation that triggered the sync.
SalesforceMapping $mapping: Salesforce mapping object for which to allow/disallow sync.
Return value
bool FALSE if the entity should not be synced to Salesforce for this mapping/sync trigger.
Related topics
1 invocation of hook_salesforce_push_entity_allowed()
- salesforce_push_entity_crud in modules/
salesforce_push/ salesforce_push.module - Push entities to Salesforce.
File
- ./
salesforce.api.php, line 150 - These are the hooks that are invoked by the Salesforce core.
Code
function hook_salesforce_push_entity_allowed($entity_type, $entity, $sf_sync_trigger, $mapping) {
// Example: Don't sync the admin user.
if ($entity_type == 'user' && $entity->uid === 1) {
return FALSE;
}
}