You are here

function salesforce_api_fieldmap_save in Salesforce Suite 7

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

Saves a fieldmap to the database.

Parameters

$map;: An array containing the fieldmap data using the following keys and values:

  • fieldmap: the numeric index of the fieldmap.
  • drupal: the name of a Drupal object.
  • salesforce: the name of a Salesforce object.
  • automatic: whether or not the sync should be automatic
  • description: a short title or description of the fieldmap
  • fields: an array that maps source fields (as keys) to their corresponding target fields (as values).
4 calls to salesforce_api_fieldmap_save()
salesforce_api_fieldmap_clone in salesforce_api/salesforce_api.module
Clones a fieldmap.
salesforce_api_fieldmap_create in salesforce_api/salesforce_api.admin.inc
Creates a new fieldmap in the database and returns its index.
salesforce_api_fieldmap_edit_form_submit in salesforce_api/salesforce_api.admin.inc
FAPI submit handler for fieldmap editor
salesforce_api_fieldmap_field_delete in salesforce_api/salesforce_api.module
Remove a field from all fieldmaps. This is particularly useful for implementations of hook_content_fieldapi('delete instance'). May be use to delete an occurence in a single fieldmap (by supplying entity/bundle and/or salesforce_type), or…

File

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

Code

function salesforce_api_fieldmap_save(&$map) {
  $primary_key = !empty($map['fieldmap']) ? 'fieldmap' : NULL;
  if (is_array($map['fields'])) {
    $map['fields'] = serialize($map['fields']);
  }
  drupal_write_record('salesforce_field_map', $map, $primary_key);
}