Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Patched Enterprise client upsert in response to issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Carroll committed Dec 23, 2010
1 parent dfb69d1 commit a12095f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions soapclient/SforceEnterpriseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,16 @@ public function update($sObjects, $type, $assignment_header = NULL, $mru_header
* that you use upsert instead of create because upsert is idempotent.
* Available in the API version 7.0 and later.
*
* @param string $ext_Id External Id
* @param array $sObjects Array of sObjects
* @param string $ext_Id External Id
* @param array $sObjects Array of sObjects
* @param string $type The type of objects being upserted.
* @return UpsertResult
*/
public function upsert($ext_Id, $sObjects) {
public function upsert($ext_Id, $sObjects, $type = 'Contact') {
$arg = new stdClass;
$arg->externalIDFieldName = new SoapVar($ext_Id, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema');
foreach ($sObjects as &$sObject) {
$sObject = new SoapVar($sObject, SOAP_ENC_OBJECT, 'Contact', $this->namespace);
$sObject = new SoapVar($sObject, SOAP_ENC_OBJECT, $type, $this->namespace);
}
$arg->sObjects = $sObjects;
return parent::_upsert($arg);
Expand All @@ -123,4 +124,4 @@ public function merge($mergeRequest, $type) {
return parent::_merge($arg);
}
}
?>
?>

0 comments on commit a12095f

Please sign in to comment.