You are here

function DrupalSalesforce::retrieve in Salesforce Suite 7

Same name and namespace in other branches
  1. 5.2 salesforce_api/salesforce.class.inc \DrupalSalesforce::retrieve()

Retrieves an object from Salesforce with standard fields and any data in fields defined in the fieldmap object.

Parameters

$ids: An array of Salesforce IDs for the objects to retrieve.

$fieldmap: The fieldmap through which to filter the data.

Return value

The single matching Salesforce objects or an array of all the objects if more than one are returned.

File

salesforce_api/salesforce.class.inc, line 129
Defines the class used for communicating with the Salesforce server.

Class

DrupalSalesforce

Code

function retrieve($ids, $fieldmap) {

  // Load the fieldmap so we can get the object name.
  $map = salesforce_api_fieldmap_load($fieldmap);
  $object = salesforce_api_fieldmap_objects_load('salesforce', 'salesforce', $map['salesforce']);
  $fields = array_keys($object['fields']);
  return $this->client
    ->retrieve(implode(', ', $fields), $map['salesforce'], $ids);
}