You are here

function salesforce_api_fieldmap_objects in Salesforce Suite 6.2

Same name and namespace in other branches
  1. 5.2 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_objects()
  2. 7 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_objects()
  3. 7.2 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_objects()

Implementation of hook_fieldmap_objects().

This will pull a cached version (if possible) of the available SF fields for the object(s) in question. Prevent excess querying!

1 call to salesforce_api_fieldmap_objects()
salesforce_api_admin_object in salesforce_api/salesforce_api.admin.inc
Ask salesforce for a list of objects and display a checklist for the user. Based on user selection, set up or tear down cached/synched Salesforce data. @TODO make this more user friendly. At the moment it's possible for an admin user to blow…

File

salesforce_api/salesforce_api.module, line 520
Defines an API that enables modules to interact with the Salesforce server.

Code

function salesforce_api_fieldmap_objects($type = 'salesforce') {
  $objects = array();

  // Define the data fields available for Salesforce objects.
  if ($type == 'salesforce') {
    $cache = cache_get('salesforce_api_sf_objects');
    if (empty($cache->data)) {
      $objects = salesforce_api_cache_build();
    }
    else {
      $objects = $cache->data;
    }
  }
  return $objects;
}