Skip to content

Commit 200ad47

Browse files
committed
Merge pull request #6 from christiaan/upsert_result
Use the UpsertResult class so we can check if it was a update or insert
2 parents e003174 + dbc4d72 commit 200ad47

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/Phpforce/SoapClient/ClientInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public function update(array $objects, $objectType);
235235
* @param array $objects Array of objects
236236
* @param string $objectType Object type, e.g., account or contact
237237
*
238-
* @return Result\SaveResult[]
238+
* @return Result\UpsertResult[]
239239
* @link http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_upsert.htm
240240
*/
241241
public function upsert($externalFieldName, array $objects, $objectType);

src/Phpforce/SoapClient/Result/UpsertResult.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,18 @@
44

55
/**
66
* Upsert result
7+
*
8+
* @see http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_upsert_upsertresult.htm
79
*/
810
class UpsertResult extends SaveResult
911
{
12+
/**
13+
* @var boolean
14+
*/
15+
protected $created;
1016

17+
public function isCreated()
18+
{
19+
return $this->created;
20+
}
1121
}

src/Phpforce/SoapClient/Soap/SoapClientFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ class SoapClientFactory
4040
'SendEmailResult' => 'Phpforce\SoapClient\Result\SendEmailResult',
4141
'SingleEmailMessage' => 'Phpforce\SoapClient\Request\SingleEmailMessage',
4242
'sObject' => 'Phpforce\SoapClient\Result\SObject',
43-
'UndeleteResult' => 'Phpforce\SoapClient\Result\UndeleteResult'
43+
'UndeleteResult' => 'Phpforce\SoapClient\Result\UndeleteResult',
44+
'UpsertResult' => 'Phpforce\SoapClient\Result\UpsertResult',
4445
);
4546

4647
/**

0 commit comments

Comments
 (0)