@@ -28,21 +28,21 @@ |
||
| 28 | 28 | |
| 29 | 29 | class PackageVersionHeader |
| 30 | 30 | { |
| 31 | - /** |
|
| 32 | - * @var array $packageVersions |
|
| 33 | - */ |
|
| 34 | - public $packageVersions; |
|
| 31 | + /** |
|
| 32 | + * @var array $packageVersions |
|
| 33 | + */ |
|
| 34 | + public $packageVersions; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Class constructor. |
|
| 38 | - * |
|
| 39 | - * @param array $packageVersions |
|
| 40 | - * @return void |
|
| 41 | - */ |
|
| 42 | - public function __construct($packageVersions) |
|
| 43 | - { |
|
| 44 | - $this->packageVersions = $packageVersions; |
|
| 45 | - } |
|
| 36 | + /** |
|
| 37 | + * Class constructor. |
|
| 38 | + * |
|
| 39 | + * @param array $packageVersions |
|
| 40 | + * @return void |
|
| 41 | + */ |
|
| 42 | + public function __construct($packageVersions) |
|
| 43 | + { |
|
| 44 | + $this->packageVersions = $packageVersions; |
|
| 45 | + } |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
@@ -28,12 +28,12 @@ |
||
| 28 | 28 | |
| 29 | 29 | class AllowFieldTruncationHeader |
| 30 | 30 | { |
| 31 | - public $allowFieldTruncation; |
|
| 31 | + public $allowFieldTruncation; |
|
| 32 | 32 | |
| 33 | - public function __construct($allowFieldTruncation) |
|
| 34 | - { |
|
| 35 | - $this->allowFieldTruncation = $allowFieldTruncation; |
|
| 36 | - } |
|
| 33 | + public function __construct($allowFieldTruncation) |
|
| 34 | + { |
|
| 35 | + $this->allowFieldTruncation = $allowFieldTruncation; |
|
| 36 | + } |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | ?> |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php namespace Davispeixoto\ForceDotComToolkitForPhp; |
| 2 | 2 | |
| 3 | - /* |
|
| 3 | + /* |
|
| 4 | 4 | * Copyright (c) 2007, salesforce.com, inc. |
| 5 | 5 | * All rights reserved. |
| 6 | 6 | * |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | * POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * This file contains two classes. |
|
| 31 | - * @package SalesforceSoapClient |
|
| 32 | - */ |
|
| 29 | + /** |
|
| 30 | + * This file contains two classes. |
|
| 31 | + * @package SalesforceSoapClient |
|
| 32 | + */ |
|
| 33 | 33 | use SoapParam; |
| 34 | 34 | use SoapVar; |
| 35 | 35 | use stdClass; |
@@ -41,130 +41,130 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | class SforceEnterpriseClient extends SforceBaseClient |
| 43 | 43 | { |
| 44 | - const ENTERPRISE_NAMESPACE = 'urn:enterprise.soap.sforce.com'; |
|
| 45 | - |
|
| 46 | - public function __construct() |
|
| 47 | - { |
|
| 48 | - $this->namespace = self::ENTERPRISE_NAMESPACE; |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - /** |
|
| 52 | - * Adds one or more new individual objects to your organization's data. |
|
| 53 | - * @param array $sObjects Array of one or more sObjects (up to 200) to create. |
|
| 54 | - * @param AssignmentRuleHeader $assignment_header is optional. Defaults to NULL |
|
| 55 | - * @param MruHeader $mru_header is optional. Defaults to NULL |
|
| 56 | - * @return SaveResult |
|
| 57 | - */ |
|
| 58 | - public function create($sObjects, $type) |
|
| 59 | - { |
|
| 60 | - $arg = []; |
|
| 61 | - foreach ($sObjects as $sObject) { |
|
| 62 | - // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #1) |
|
| 63 | - $xmlStr = ''; |
|
| 64 | - if (isset($sObject->fieldsToNull) && is_array($sObject->fieldsToNull)) { |
|
| 65 | - foreach ($sObject->fieldsToNull as $fieldToNull) { |
|
| 66 | - $xmlStr .= '<fieldsToNull>' . $fieldToNull . '</fieldsToNull>'; |
|
| 67 | - } |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - $soapObject = new SoapVar($sObject, SOAP_ENC_OBJECT, $type, $this->namespace); |
|
| 71 | - |
|
| 72 | - // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #2) |
|
| 73 | - if ($xmlStr != '') { |
|
| 74 | - $soapObject->enc_value->fieldsToNull = new SoapVar(new SoapVar($xmlStr, XSD_ANYXML), SOAP_ENC_ARRAY); |
|
| 75 | - } |
|
| 76 | - $arg[] = $soapObject; |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - return parent::_create(new SoapParam($arg, "sObjects")); |
|
| 80 | - } |
|
| 81 | - |
|
| 82 | - /** |
|
| 83 | - * Updates one or more new individual objects to your organization's data. |
|
| 84 | - * @param array sObjects Array of sObjects |
|
| 85 | - * @param AssignmentRuleHeader $assignment_header is optional. Defaults to NULL |
|
| 86 | - * @param MruHeader $mru_header is optional. Defaults to NULL |
|
| 87 | - * @return UpdateResult |
|
| 88 | - */ |
|
| 89 | - public function update($sObjects, $type, $assignment_header = null, $mru_header = null) |
|
| 90 | - { |
|
| 91 | - $arg = new stdClass; |
|
| 92 | - $arg->sObjects = []; |
|
| 93 | - foreach ($sObjects as $sObject) { |
|
| 94 | - // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #1) |
|
| 95 | - $xmlStr = ''; |
|
| 96 | - if (isset($sObject->fieldsToNull) && is_array($sObject->fieldsToNull)) { |
|
| 97 | - foreach ($sObject->fieldsToNull as $fieldToNull) { |
|
| 98 | - $xmlStr .= '<fieldsToNull>' . $fieldToNull . '</fieldsToNull>'; |
|
| 99 | - } |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - $soapObject = new SoapVar($sObject, SOAP_ENC_OBJECT, $type, $this->namespace); |
|
| 103 | - |
|
| 104 | - // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #2) |
|
| 105 | - if ($xmlStr != '') { |
|
| 106 | - $soapObject->enc_value->fieldsToNull = new SoapVar(new SoapVar($xmlStr, XSD_ANYXML), SOAP_ENC_ARRAY); |
|
| 107 | - } |
|
| 108 | - $arg->sObjects[] = $soapObject; |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - return parent::_update($arg); |
|
| 112 | - } |
|
| 113 | - |
|
| 114 | - /** |
|
| 115 | - * Creates new objects and updates existing objects; uses a custom field to |
|
| 116 | - * determine the presence of existing objects. In most cases, we recommend |
|
| 117 | - * that you use upsert instead of create because upsert is idempotent. |
|
| 118 | - * Available in the API version 7.0 and later. |
|
| 119 | - * |
|
| 120 | - * @param string $ext_Id External Id |
|
| 121 | - * @param array $sObjects Array of sObjects |
|
| 122 | - * @param string $type The type of objects being upserted. |
|
| 123 | - * @return UpsertResult |
|
| 124 | - */ |
|
| 125 | - public function upsert($ext_Id, $sObjects, $type = 'Contact') |
|
| 126 | - { |
|
| 127 | - $arg = new stdClass; |
|
| 128 | - $arg->sObjects = []; |
|
| 129 | - $arg->externalIDFieldName = new SoapVar($ext_Id, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema'); |
|
| 130 | - |
|
| 131 | - foreach ($sObjects as $sObject) { |
|
| 132 | - // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #1) |
|
| 133 | - $xmlStr = ''; |
|
| 134 | - if (isset($sObject->fieldsToNull) && is_array($sObject->fieldsToNull)) { |
|
| 135 | - foreach ($sObject->fieldsToNull as $fieldToNull) { |
|
| 136 | - $xmlStr .= '<fieldsToNull>' . $fieldToNull . '</fieldsToNull>'; |
|
| 137 | - } |
|
| 138 | - } |
|
| 139 | - |
|
| 140 | - $soapObject = new SoapVar($sObject, SOAP_ENC_OBJECT, $type, $this->namespace); |
|
| 141 | - |
|
| 142 | - // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #2) |
|
| 143 | - if ($xmlStr != '') { |
|
| 144 | - $soapObject->enc_value->fieldsToNull = new SoapVar(new SoapVar($xmlStr, XSD_ANYXML), SOAP_ENC_ARRAY); |
|
| 145 | - } |
|
| 146 | - $arg->sObjects[] = $soapObject; |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - return parent::_upsert($arg); |
|
| 150 | - } |
|
| 151 | - |
|
| 152 | - /** |
|
| 153 | - * Merge records |
|
| 154 | - * |
|
| 155 | - * @param stdclass $mergeRequest |
|
| 156 | - * @param String $type |
|
| 157 | - * @return unknown |
|
| 158 | - */ |
|
| 159 | - public function merge($mergeRequest, $type) |
|
| 160 | - { |
|
| 161 | - $mergeRequest->masterRecord = new SoapVar($mergeRequest->masterRecord, SOAP_ENC_OBJECT, $type, |
|
| 162 | - $this->namespace); |
|
| 163 | - $arg = new stdClass; |
|
| 164 | - $arg->request = new SoapVar($mergeRequest, SOAP_ENC_OBJECT, 'MergeRequest', $this->namespace); |
|
| 165 | - |
|
| 166 | - return parent::_merge($arg); |
|
| 167 | - } |
|
| 44 | + const ENTERPRISE_NAMESPACE = 'urn:enterprise.soap.sforce.com'; |
|
| 45 | + |
|
| 46 | + public function __construct() |
|
| 47 | + { |
|
| 48 | + $this->namespace = self::ENTERPRISE_NAMESPACE; |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + /** |
|
| 52 | + * Adds one or more new individual objects to your organization's data. |
|
| 53 | + * @param array $sObjects Array of one or more sObjects (up to 200) to create. |
|
| 54 | + * @param AssignmentRuleHeader $assignment_header is optional. Defaults to NULL |
|
| 55 | + * @param MruHeader $mru_header is optional. Defaults to NULL |
|
| 56 | + * @return SaveResult |
|
| 57 | + */ |
|
| 58 | + public function create($sObjects, $type) |
|
| 59 | + { |
|
| 60 | + $arg = []; |
|
| 61 | + foreach ($sObjects as $sObject) { |
|
| 62 | + // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #1) |
|
| 63 | + $xmlStr = ''; |
|
| 64 | + if (isset($sObject->fieldsToNull) && is_array($sObject->fieldsToNull)) { |
|
| 65 | + foreach ($sObject->fieldsToNull as $fieldToNull) { |
|
| 66 | + $xmlStr .= '<fieldsToNull>' . $fieldToNull . '</fieldsToNull>'; |
|
| 67 | + } |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + $soapObject = new SoapVar($sObject, SOAP_ENC_OBJECT, $type, $this->namespace); |
|
| 71 | + |
|
| 72 | + // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #2) |
|
| 73 | + if ($xmlStr != '') { |
|
| 74 | + $soapObject->enc_value->fieldsToNull = new SoapVar(new SoapVar($xmlStr, XSD_ANYXML), SOAP_ENC_ARRAY); |
|
| 75 | + } |
|
| 76 | + $arg[] = $soapObject; |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + return parent::_create(new SoapParam($arg, "sObjects")); |
|
| 80 | + } |
|
| 81 | + |
|
| 82 | + /** |
|
| 83 | + * Updates one or more new individual objects to your organization's data. |
|
| 84 | + * @param array sObjects Array of sObjects |
|
| 85 | + * @param AssignmentRuleHeader $assignment_header is optional. Defaults to NULL |
|
| 86 | + * @param MruHeader $mru_header is optional. Defaults to NULL |
|
| 87 | + * @return UpdateResult |
|
| 88 | + */ |
|
| 89 | + public function update($sObjects, $type, $assignment_header = null, $mru_header = null) |
|
| 90 | + { |
|
| 91 | + $arg = new stdClass; |
|
| 92 | + $arg->sObjects = []; |
|
| 93 | + foreach ($sObjects as $sObject) { |
|
| 94 | + // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #1) |
|
| 95 | + $xmlStr = ''; |
|
| 96 | + if (isset($sObject->fieldsToNull) && is_array($sObject->fieldsToNull)) { |
|
| 97 | + foreach ($sObject->fieldsToNull as $fieldToNull) { |
|
| 98 | + $xmlStr .= '<fieldsToNull>' . $fieldToNull . '</fieldsToNull>'; |
|
| 99 | + } |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + $soapObject = new SoapVar($sObject, SOAP_ENC_OBJECT, $type, $this->namespace); |
|
| 103 | + |
|
| 104 | + // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #2) |
|
| 105 | + if ($xmlStr != '') { |
|
| 106 | + $soapObject->enc_value->fieldsToNull = new SoapVar(new SoapVar($xmlStr, XSD_ANYXML), SOAP_ENC_ARRAY); |
|
| 107 | + } |
|
| 108 | + $arg->sObjects[] = $soapObject; |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + return parent::_update($arg); |
|
| 112 | + } |
|
| 113 | + |
|
| 114 | + /** |
|
| 115 | + * Creates new objects and updates existing objects; uses a custom field to |
|
| 116 | + * determine the presence of existing objects. In most cases, we recommend |
|
| 117 | + * that you use upsert instead of create because upsert is idempotent. |
|
| 118 | + * Available in the API version 7.0 and later. |
|
| 119 | + * |
|
| 120 | + * @param string $ext_Id External Id |
|
| 121 | + * @param array $sObjects Array of sObjects |
|
| 122 | + * @param string $type The type of objects being upserted. |
|
| 123 | + * @return UpsertResult |
|
| 124 | + */ |
|
| 125 | + public function upsert($ext_Id, $sObjects, $type = 'Contact') |
|
| 126 | + { |
|
| 127 | + $arg = new stdClass; |
|
| 128 | + $arg->sObjects = []; |
|
| 129 | + $arg->externalIDFieldName = new SoapVar($ext_Id, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema'); |
|
| 130 | + |
|
| 131 | + foreach ($sObjects as $sObject) { |
|
| 132 | + // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #1) |
|
| 133 | + $xmlStr = ''; |
|
| 134 | + if (isset($sObject->fieldsToNull) && is_array($sObject->fieldsToNull)) { |
|
| 135 | + foreach ($sObject->fieldsToNull as $fieldToNull) { |
|
| 136 | + $xmlStr .= '<fieldsToNull>' . $fieldToNull . '</fieldsToNull>'; |
|
| 137 | + } |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + $soapObject = new SoapVar($sObject, SOAP_ENC_OBJECT, $type, $this->namespace); |
|
| 141 | + |
|
| 142 | + // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #2) |
|
| 143 | + if ($xmlStr != '') { |
|
| 144 | + $soapObject->enc_value->fieldsToNull = new SoapVar(new SoapVar($xmlStr, XSD_ANYXML), SOAP_ENC_ARRAY); |
|
| 145 | + } |
|
| 146 | + $arg->sObjects[] = $soapObject; |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + return parent::_upsert($arg); |
|
| 150 | + } |
|
| 151 | + |
|
| 152 | + /** |
|
| 153 | + * Merge records |
|
| 154 | + * |
|
| 155 | + * @param stdclass $mergeRequest |
|
| 156 | + * @param String $type |
|
| 157 | + * @return unknown |
|
| 158 | + */ |
|
| 159 | + public function merge($mergeRequest, $type) |
|
| 160 | + { |
|
| 161 | + $mergeRequest->masterRecord = new SoapVar($mergeRequest->masterRecord, SOAP_ENC_OBJECT, $type, |
|
| 162 | + $this->namespace); |
|
| 163 | + $arg = new stdClass; |
|
| 164 | + $arg->request = new SoapVar($mergeRequest, SOAP_ENC_OBJECT, 'MergeRequest', $this->namespace); |
|
| 165 | + |
|
| 166 | + return parent::_merge($arg); |
|
| 167 | + } |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | ?> |
@@ -28,23 +28,23 @@ |
||
| 28 | 28 | |
| 29 | 29 | class SforceFieldTypes |
| 30 | 30 | { |
| 31 | - const DEPLOYMENT_STATUS_INDEVELOPMENT = 'InDevelopment'; |
|
| 32 | - const DEPLOYMENT_STATUS_DEPLOYED = 'Deployed'; |
|
| 31 | + const DEPLOYMENT_STATUS_INDEVELOPMENT = 'InDevelopment'; |
|
| 32 | + const DEPLOYMENT_STATUS_DEPLOYED = 'Deployed'; |
|
| 33 | 33 | |
| 34 | - const GENDER_NEUTER = 'Neuter'; |
|
| 35 | - const GENDER_MASCULINE = 'Masculine'; |
|
| 36 | - const GENDER_FEMININE = 'Feminine'; |
|
| 34 | + const GENDER_NEUTER = 'Neuter'; |
|
| 35 | + const GENDER_MASCULINE = 'Masculine'; |
|
| 36 | + const GENDER_FEMININE = 'Feminine'; |
|
| 37 | 37 | |
| 38 | - const SHARING_MODEL_PRIVATE = 'Private'; |
|
| 39 | - const SHARING_MODEL_READ = 'Read'; |
|
| 40 | - const SHARING_MODEL_READWRITE = 'ReadWrite'; |
|
| 38 | + const SHARING_MODEL_PRIVATE = 'Private'; |
|
| 39 | + const SHARING_MODEL_READ = 'Read'; |
|
| 40 | + const SHARING_MODEL_READWRITE = 'ReadWrite'; |
|
| 41 | 41 | |
| 42 | - const STARTS_WITH_CONSONANT = 'Consonant'; |
|
| 43 | - const STARTS_WITH_VOWEL = 'Vowel'; |
|
| 44 | - const STARTS_WITH_SPECIAL = 'Special'; |
|
| 42 | + const STARTS_WITH_CONSONANT = 'Consonant'; |
|
| 43 | + const STARTS_WITH_VOWEL = 'Vowel'; |
|
| 44 | + const STARTS_WITH_SPECIAL = 'Special'; |
|
| 45 | 45 | |
| 46 | - const TREAT_BLANKS_AS_BLANK = 'BlankAsBlank'; |
|
| 47 | - const TREAT_BLANKS_AS_ZERO = 'BlankAsZero'; |
|
| 46 | + const TREAT_BLANKS_AS_BLANK = 'BlankAsBlank'; |
|
| 47 | + const TREAT_BLANKS_AS_ZERO = 'BlankAsZero'; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | ?> |
@@ -28,12 +28,12 @@ |
||
| 28 | 28 | |
| 29 | 29 | class UserTerritoryDeleteHeader |
| 30 | 30 | { |
| 31 | - public $transferToUserId; |
|
| 31 | + public $transferToUserId; |
|
| 32 | 32 | |
| 33 | - public function __construct($transferToUserId) |
|
| 34 | - { |
|
| 35 | - $this->transferToUserId = $transferToUserId; |
|
| 36 | - } |
|
| 33 | + public function __construct($transferToUserId) |
|
| 34 | + { |
|
| 35 | + $this->transferToUserId = $transferToUserId; |
|
| 36 | + } |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | ?> |
@@ -29,18 +29,18 @@ |
||
| 29 | 29 | |
| 30 | 30 | class LocaleOptions |
| 31 | 31 | { |
| 32 | - public $language; |
|
| 32 | + public $language; |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Class constructor. |
|
| 36 | - * |
|
| 37 | - * @param string $language |
|
| 38 | - * @return void |
|
| 39 | - */ |
|
| 40 | - public function __construct($language) |
|
| 41 | - { |
|
| 42 | - $this->language = $language; |
|
| 43 | - } |
|
| 34 | + /** |
|
| 35 | + * Class constructor. |
|
| 36 | + * |
|
| 37 | + * @param string $language |
|
| 38 | + * @return void |
|
| 39 | + */ |
|
| 40 | + public function __construct($language) |
|
| 41 | + { |
|
| 42 | + $this->language = $language; |
|
| 43 | + } |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | ?> |
@@ -28,19 +28,19 @@ |
||
| 28 | 28 | |
| 29 | 29 | class EmailHeader |
| 30 | 30 | { |
| 31 | - public $triggerAutoResponseEmail; |
|
| 32 | - public $triggerOtherEmail; |
|
| 33 | - public $triggerUserEmail; |
|
| 31 | + public $triggerAutoResponseEmail; |
|
| 32 | + public $triggerOtherEmail; |
|
| 33 | + public $triggerUserEmail; |
|
| 34 | 34 | |
| 35 | - public function __construct( |
|
| 36 | - $triggerAutoResponseEmail = false, |
|
| 37 | - $triggerOtherEmail = false, |
|
| 38 | - $triggerUserEmail = false |
|
| 39 | - ) { |
|
| 40 | - $this->triggerAutoResponseEmail = $triggerAutoResponseEmail; |
|
| 41 | - $this->triggerOtherEmail = $triggerOtherEmail; |
|
| 42 | - $this->triggerUserEmail = $triggerUserEmail; |
|
| 43 | - } |
|
| 35 | + public function __construct( |
|
| 36 | + $triggerAutoResponseEmail = false, |
|
| 37 | + $triggerOtherEmail = false, |
|
| 38 | + $triggerUserEmail = false |
|
| 39 | + ) { |
|
| 40 | + $this->triggerAutoResponseEmail = $triggerAutoResponseEmail; |
|
| 41 | + $this->triggerOtherEmail = $triggerOtherEmail; |
|
| 42 | + $this->triggerUserEmail = $triggerUserEmail; |
|
| 43 | + } |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | ?> |
@@ -28,145 +28,145 @@ |
||
| 28 | 28 | |
| 29 | 29 | class SforceCustomField |
| 30 | 30 | { |
| 31 | - public function setCaseSensitive($caseSensitive) |
|
| 32 | - { |
|
| 33 | - $this->caseSensitive = $caseSensitive; |
|
| 34 | - } |
|
| 35 | - |
|
| 36 | - public function setDefaultValue($defaultValue) |
|
| 37 | - { |
|
| 38 | - $this->defaultValue = $defaultValue; |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - public function setDescription($description) |
|
| 42 | - { |
|
| 43 | - $this->description = $description; |
|
| 44 | - } |
|
| 45 | - |
|
| 46 | - public function setDisplayFormat($displayFormat) |
|
| 47 | - { |
|
| 48 | - $this->displayFormat = $displayFormat; |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - public function setExternalId($externalId) |
|
| 52 | - { |
|
| 53 | - $this->externalId = $externalId; |
|
| 54 | - } |
|
| 55 | - |
|
| 56 | - public function setFormula($formula) |
|
| 57 | - { |
|
| 58 | - $this->formula = $formula; |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - public function setFormulaTreatBlankAs($formulaTreatBlankAs) |
|
| 62 | - { |
|
| 63 | - $this->formulaTreatBlankAs = $formulaTreatBlankAs; |
|
| 64 | - } |
|
| 65 | - |
|
| 66 | - public function setFullName($fullName) |
|
| 67 | - { |
|
| 68 | - $this->fullName = $fullName; |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - public function setInlineHelpText($inlineHelpText) |
|
| 72 | - { |
|
| 73 | - $this->inlineHelpText = $inlineHelpText; |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - public function setLabel($label) |
|
| 77 | - { |
|
| 78 | - $this->label = $label; |
|
| 79 | - } |
|
| 80 | - |
|
| 81 | - public function setLength($length) |
|
| 82 | - { |
|
| 83 | - $this->length = $length; |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - public function setMaskChar($maskChar) |
|
| 87 | - { |
|
| 88 | - $this->maskChar = $maskChar; |
|
| 89 | - } |
|
| 90 | - |
|
| 91 | - public function setMaskType($maskType) |
|
| 92 | - { |
|
| 93 | - $this->maskType = $maskType; |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - public function setPicklist($picklist) |
|
| 97 | - { |
|
| 98 | - $this->picklist = $picklist; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - public function setPopulateExistingRows($populateExistingRows) |
|
| 102 | - { |
|
| 103 | - $this->populateExistingRows = $populateExistingRows; |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - public function setPrecision($precision) |
|
| 107 | - { |
|
| 108 | - $this->precision = $precision; |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - public function setReferenceTo($referenceTo) |
|
| 112 | - { |
|
| 113 | - $this->referenceTo = $referenceTo; |
|
| 114 | - } |
|
| 115 | - |
|
| 116 | - public function setRelationshipName($relationshipName) |
|
| 117 | - { |
|
| 118 | - $this->relationshipName = $relationshipName; |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - public function setRequired($required) |
|
| 122 | - { |
|
| 123 | - $this->required = $required; |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - public function setScale($scale) |
|
| 127 | - { |
|
| 128 | - $this->scale = $scale; |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - public function setStartingNumber($startingNumber) |
|
| 132 | - { |
|
| 133 | - $this->startingNumber = $startingNumber; |
|
| 134 | - } |
|
| 135 | - |
|
| 136 | - public function setSummarizeField($summarizeField) |
|
| 137 | - { |
|
| 138 | - $this->summarizeField = $summarizeField; |
|
| 139 | - } |
|
| 140 | - |
|
| 141 | - public function setSummaryFilterItems($summaryFilterItems) |
|
| 142 | - { |
|
| 143 | - $this->summaryFilterItems = $summaryFilterItems; |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - public function setSummaryForeignKey($summaryForeignKey) |
|
| 147 | - { |
|
| 148 | - $this->summaryForeignKey = $summaryForeignKey; |
|
| 149 | - } |
|
| 150 | - |
|
| 151 | - public function setSummaryOperation($summaryOperation) |
|
| 152 | - { |
|
| 153 | - $this->summaryOperation = $summaryOperation; |
|
| 154 | - } |
|
| 155 | - |
|
| 156 | - public function setType($type) |
|
| 157 | - { |
|
| 158 | - $this->type = $type; |
|
| 159 | - } |
|
| 160 | - |
|
| 161 | - public function setUnique($unique) |
|
| 162 | - { |
|
| 163 | - $this->unique = $unique; |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - public function setVisibleLines($visibleLines) |
|
| 167 | - { |
|
| 168 | - $this->visibleLines = $visibleLines; |
|
| 169 | - } |
|
| 31 | + public function setCaseSensitive($caseSensitive) |
|
| 32 | + { |
|
| 33 | + $this->caseSensitive = $caseSensitive; |
|
| 34 | + } |
|
| 35 | + |
|
| 36 | + public function setDefaultValue($defaultValue) |
|
| 37 | + { |
|
| 38 | + $this->defaultValue = $defaultValue; |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + public function setDescription($description) |
|
| 42 | + { |
|
| 43 | + $this->description = $description; |
|
| 44 | + } |
|
| 45 | + |
|
| 46 | + public function setDisplayFormat($displayFormat) |
|
| 47 | + { |
|
| 48 | + $this->displayFormat = $displayFormat; |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + public function setExternalId($externalId) |
|
| 52 | + { |
|
| 53 | + $this->externalId = $externalId; |
|
| 54 | + } |
|
| 55 | + |
|
| 56 | + public function setFormula($formula) |
|
| 57 | + { |
|
| 58 | + $this->formula = $formula; |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + public function setFormulaTreatBlankAs($formulaTreatBlankAs) |
|
| 62 | + { |
|
| 63 | + $this->formulaTreatBlankAs = $formulaTreatBlankAs; |
|
| 64 | + } |
|
| 65 | + |
|
| 66 | + public function setFullName($fullName) |
|
| 67 | + { |
|
| 68 | + $this->fullName = $fullName; |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + public function setInlineHelpText($inlineHelpText) |
|
| 72 | + { |
|
| 73 | + $this->inlineHelpText = $inlineHelpText; |
|
| 74 | + } |
|
| 75 | + |
|
| 76 | + public function setLabel($label) |
|
| 77 | + { |
|
| 78 | + $this->label = $label; |
|
| 79 | + } |
|
| 80 | + |
|
| 81 | + public function setLength($length) |
|
| 82 | + { |
|
| 83 | + $this->length = $length; |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + public function setMaskChar($maskChar) |
|
| 87 | + { |
|
| 88 | + $this->maskChar = $maskChar; |
|
| 89 | + } |
|
| 90 | + |
|
| 91 | + public function setMaskType($maskType) |
|
| 92 | + { |
|
| 93 | + $this->maskType = $maskType; |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + public function setPicklist($picklist) |
|
| 97 | + { |
|
| 98 | + $this->picklist = $picklist; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + public function setPopulateExistingRows($populateExistingRows) |
|
| 102 | + { |
|
| 103 | + $this->populateExistingRows = $populateExistingRows; |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + public function setPrecision($precision) |
|
| 107 | + { |
|
| 108 | + $this->precision = $precision; |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + public function setReferenceTo($referenceTo) |
|
| 112 | + { |
|
| 113 | + $this->referenceTo = $referenceTo; |
|
| 114 | + } |
|
| 115 | + |
|
| 116 | + public function setRelationshipName($relationshipName) |
|
| 117 | + { |
|
| 118 | + $this->relationshipName = $relationshipName; |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + public function setRequired($required) |
|
| 122 | + { |
|
| 123 | + $this->required = $required; |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + public function setScale($scale) |
|
| 127 | + { |
|
| 128 | + $this->scale = $scale; |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + public function setStartingNumber($startingNumber) |
|
| 132 | + { |
|
| 133 | + $this->startingNumber = $startingNumber; |
|
| 134 | + } |
|
| 135 | + |
|
| 136 | + public function setSummarizeField($summarizeField) |
|
| 137 | + { |
|
| 138 | + $this->summarizeField = $summarizeField; |
|
| 139 | + } |
|
| 140 | + |
|
| 141 | + public function setSummaryFilterItems($summaryFilterItems) |
|
| 142 | + { |
|
| 143 | + $this->summaryFilterItems = $summaryFilterItems; |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + public function setSummaryForeignKey($summaryForeignKey) |
|
| 147 | + { |
|
| 148 | + $this->summaryForeignKey = $summaryForeignKey; |
|
| 149 | + } |
|
| 150 | + |
|
| 151 | + public function setSummaryOperation($summaryOperation) |
|
| 152 | + { |
|
| 153 | + $this->summaryOperation = $summaryOperation; |
|
| 154 | + } |
|
| 155 | + |
|
| 156 | + public function setType($type) |
|
| 157 | + { |
|
| 158 | + $this->type = $type; |
|
| 159 | + } |
|
| 160 | + |
|
| 161 | + public function setUnique($unique) |
|
| 162 | + { |
|
| 163 | + $this->unique = $unique; |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + public function setVisibleLines($visibleLines) |
|
| 167 | + { |
|
| 168 | + $this->visibleLines = $visibleLines; |
|
| 169 | + } |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | ?> |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php namespace Davispeixoto\ForceDotComToolkitForPhp; |
| 2 | 2 | |
| 3 | - /* |
|
| 3 | + /* |
|
| 4 | 4 | * Copyright (c) 2007, salesforce.com, inc. |
| 5 | 5 | * All rights reserved. |
| 6 | 6 | * |
@@ -34,173 +34,173 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | class SforcePartnerClient extends SforceBaseClient |
| 36 | 36 | { |
| 37 | - const PARTNER_NAMESPACE = 'urn:partner.soap.sforce.com'; |
|
| 38 | - |
|
| 39 | - function SforcePartnerClient() |
|
| 40 | - { |
|
| 41 | - $this->namespace = self::PARTNER_NAMESPACE; |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - protected function getSoapClient($wsdl, $options) |
|
| 45 | - { |
|
| 46 | - return new SforceSoapClient($wsdl, $options); |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - /** |
|
| 50 | - * Adds one or more new individual objects to your organization's data. |
|
| 51 | - * @param array $sObjects Array of one or more sObjects (up to 200) to create. |
|
| 52 | - * @return SaveResult |
|
| 53 | - */ |
|
| 54 | - public function create($sObjects) |
|
| 55 | - { |
|
| 56 | - $arg = new stdClass; |
|
| 57 | - foreach ($sObjects as $sObject) { |
|
| 58 | - if (isset ($sObject->fields)) { |
|
| 59 | - $sObject->any = $this->_convertToAny($sObject->fields); |
|
| 60 | - } |
|
| 61 | - } |
|
| 62 | - $arg->sObjects = $sObjects; |
|
| 63 | - |
|
| 64 | - return parent::_create($arg); |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * Merge records |
|
| 69 | - * |
|
| 70 | - * @param stdclass $mergeRequest |
|
| 71 | - * @param String $type |
|
| 72 | - * @return mixed |
|
| 73 | - */ |
|
| 74 | - public function merge($mergeRequest) |
|
| 75 | - { |
|
| 76 | - if (isset($mergeRequest->masterRecord)) { |
|
| 77 | - if (isset($mergeRequest->masterRecord->fields)) { |
|
| 78 | - $mergeRequest->masterRecord->any = $this->_convertToAny($mergeRequest->masterRecord->fields); |
|
| 79 | - } |
|
| 80 | - $arg = new stdClass(); |
|
| 81 | - $arg->request = $mergeRequest; |
|
| 82 | - |
|
| 83 | - return $this->_merge($arg); |
|
| 84 | - } |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * |
|
| 89 | - * @param array $request |
|
| 90 | - */ |
|
| 91 | - public function sendSingleEmail($request) |
|
| 92 | - { |
|
| 93 | - if (is_array($request)) { |
|
| 94 | - $messages = array(); |
|
| 95 | - foreach ($request as $r) { |
|
| 96 | - $email = new \SoapVar($r, SOAP_ENC_OBJECT, 'SingleEmailMessage', $this->namespace); |
|
| 97 | - array_push($messages, $email); |
|
| 98 | - } |
|
| 99 | - $arg->messages = $messages; |
|
| 100 | - |
|
| 101 | - return parent::_sendEmail($arg); |
|
| 102 | - } else { |
|
| 103 | - $backtrace = debug_backtrace(); |
|
| 104 | - error_log('Please pass in array to this function: ' . $backtrace[0]['function']); |
|
| 105 | - return false; |
|
| 106 | - } |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - /** |
|
| 110 | - * |
|
| 111 | - * @param array $request |
|
| 112 | - */ |
|
| 113 | - public function sendMassEmail($request) |
|
| 114 | - { |
|
| 115 | - $arg = new stdClass(); |
|
| 116 | - if (is_array($request)) { |
|
| 117 | - $messages = array(); |
|
| 118 | - foreach ($request as $r) { |
|
| 119 | - $email = new \SoapVar($r, SOAP_ENC_OBJECT, 'MassEmailMessage', $this->namespace); |
|
| 120 | - array_push($messages, $email); |
|
| 121 | - } |
|
| 122 | - $arg->messages = $messages; |
|
| 123 | - |
|
| 124 | - return parent::_sendEmail($arg); |
|
| 125 | - } else { |
|
| 126 | - $backtrace = debug_backtrace(); |
|
| 127 | - error_log('Please pass in array to this function: ' . $backtrace[0]['function']); |
|
| 128 | - return false; |
|
| 129 | - } |
|
| 130 | - } |
|
| 131 | - |
|
| 132 | - /** |
|
| 133 | - * Updates one or more new individual objects to your organization's data. |
|
| 134 | - * @param array sObjects Array of sObjects |
|
| 135 | - * @return UpdateResult |
|
| 136 | - */ |
|
| 137 | - public function update($sObjects) |
|
| 138 | - { |
|
| 139 | - $arg = new stdClass; |
|
| 140 | - foreach ($sObjects as $sObject) { |
|
| 141 | - if (isset($sObject->fields)) { |
|
| 142 | - $sObject->any = $this->_convertToAny($sObject->fields); |
|
| 143 | - } |
|
| 144 | - } |
|
| 145 | - $arg->sObjects = $sObjects; |
|
| 146 | - |
|
| 147 | - return parent::_update($arg); |
|
| 148 | - } |
|
| 149 | - |
|
| 150 | - /** |
|
| 151 | - * Creates new objects and updates existing objects; uses a custom field to |
|
| 152 | - * determine the presence of existing objects. In most cases, we recommend |
|
| 153 | - * that you use upsert instead of create because upsert is idempotent. |
|
| 154 | - * Available in the API version 7.0 and later. |
|
| 155 | - * |
|
| 156 | - * @param string $ext_Id External Id |
|
| 157 | - * @param array $sObjects Array of sObjects |
|
| 158 | - * @return UpsertResult |
|
| 159 | - */ |
|
| 160 | - public function upsert($ext_Id, $sObjects) |
|
| 161 | - { |
|
| 162 | - $arg = new stdClass; |
|
| 163 | - $arg->externalIDFieldName = new \SoapVar($ext_Id, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema'); |
|
| 164 | - foreach ($sObjects as $sObject) { |
|
| 165 | - if (isset ($sObject->fields)) { |
|
| 166 | - $sObject->any = $this->_convertToAny($sObject->fields); |
|
| 167 | - } |
|
| 168 | - } |
|
| 169 | - $arg->sObjects = $sObjects; |
|
| 170 | - |
|
| 171 | - return parent::_upsert($arg); |
|
| 172 | - } |
|
| 173 | - |
|
| 174 | - /** |
|
| 175 | - * @param string $fieldList |
|
| 176 | - * @param string $sObjectType |
|
| 177 | - * @param array $ids |
|
| 178 | - * @return string |
|
| 179 | - */ |
|
| 180 | - public function retrieve($fieldList, $sObjectType, $ids) |
|
| 181 | - { |
|
| 182 | - return $this->_retrieveResult(parent::retrieve($fieldList, $sObjectType, $ids)); |
|
| 183 | - } |
|
| 184 | - |
|
| 185 | - /** |
|
| 186 | - * |
|
| 187 | - * @param mixed $response |
|
| 188 | - * @return array |
|
| 189 | - */ |
|
| 190 | - private function _retrieveResult($response) |
|
| 191 | - { |
|
| 192 | - $arr = array(); |
|
| 193 | - if (is_array($response)) { |
|
| 194 | - foreach ($response as $r) { |
|
| 195 | - $sobject = new SObject($r); |
|
| 196 | - array_push($arr, $sobject); |
|
| 197 | - } |
|
| 198 | - } else { |
|
| 199 | - $sobject = new SObject($response); |
|
| 200 | - array_push($arr, $sobject); |
|
| 201 | - } |
|
| 202 | - |
|
| 203 | - return $arr; |
|
| 204 | - } |
|
| 37 | + const PARTNER_NAMESPACE = 'urn:partner.soap.sforce.com'; |
|
| 38 | + |
|
| 39 | + function SforcePartnerClient() |
|
| 40 | + { |
|
| 41 | + $this->namespace = self::PARTNER_NAMESPACE; |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + protected function getSoapClient($wsdl, $options) |
|
| 45 | + { |
|
| 46 | + return new SforceSoapClient($wsdl, $options); |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + /** |
|
| 50 | + * Adds one or more new individual objects to your organization's data. |
|
| 51 | + * @param array $sObjects Array of one or more sObjects (up to 200) to create. |
|
| 52 | + * @return SaveResult |
|
| 53 | + */ |
|
| 54 | + public function create($sObjects) |
|
| 55 | + { |
|
| 56 | + $arg = new stdClass; |
|
| 57 | + foreach ($sObjects as $sObject) { |
|
| 58 | + if (isset ($sObject->fields)) { |
|
| 59 | + $sObject->any = $this->_convertToAny($sObject->fields); |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | + $arg->sObjects = $sObjects; |
|
| 63 | + |
|
| 64 | + return parent::_create($arg); |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * Merge records |
|
| 69 | + * |
|
| 70 | + * @param stdclass $mergeRequest |
|
| 71 | + * @param String $type |
|
| 72 | + * @return mixed |
|
| 73 | + */ |
|
| 74 | + public function merge($mergeRequest) |
|
| 75 | + { |
|
| 76 | + if (isset($mergeRequest->masterRecord)) { |
|
| 77 | + if (isset($mergeRequest->masterRecord->fields)) { |
|
| 78 | + $mergeRequest->masterRecord->any = $this->_convertToAny($mergeRequest->masterRecord->fields); |
|
| 79 | + } |
|
| 80 | + $arg = new stdClass(); |
|
| 81 | + $arg->request = $mergeRequest; |
|
| 82 | + |
|
| 83 | + return $this->_merge($arg); |
|
| 84 | + } |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * |
|
| 89 | + * @param array $request |
|
| 90 | + */ |
|
| 91 | + public function sendSingleEmail($request) |
|
| 92 | + { |
|
| 93 | + if (is_array($request)) { |
|
| 94 | + $messages = array(); |
|
| 95 | + foreach ($request as $r) { |
|
| 96 | + $email = new \SoapVar($r, SOAP_ENC_OBJECT, 'SingleEmailMessage', $this->namespace); |
|
| 97 | + array_push($messages, $email); |
|
| 98 | + } |
|
| 99 | + $arg->messages = $messages; |
|
| 100 | + |
|
| 101 | + return parent::_sendEmail($arg); |
|
| 102 | + } else { |
|
| 103 | + $backtrace = debug_backtrace(); |
|
| 104 | + error_log('Please pass in array to this function: ' . $backtrace[0]['function']); |
|
| 105 | + return false; |
|
| 106 | + } |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + /** |
|
| 110 | + * |
|
| 111 | + * @param array $request |
|
| 112 | + */ |
|
| 113 | + public function sendMassEmail($request) |
|
| 114 | + { |
|
| 115 | + $arg = new stdClass(); |
|
| 116 | + if (is_array($request)) { |
|
| 117 | + $messages = array(); |
|
| 118 | + foreach ($request as $r) { |
|
| 119 | + $email = new \SoapVar($r, SOAP_ENC_OBJECT, 'MassEmailMessage', $this->namespace); |
|
| 120 | + array_push($messages, $email); |
|
| 121 | + } |
|
| 122 | + $arg->messages = $messages; |
|
| 123 | + |
|
| 124 | + return parent::_sendEmail($arg); |
|
| 125 | + } else { |
|
| 126 | + $backtrace = debug_backtrace(); |
|
| 127 | + error_log('Please pass in array to this function: ' . $backtrace[0]['function']); |
|
| 128 | + return false; |
|
| 129 | + } |
|
| 130 | + } |
|
| 131 | + |
|
| 132 | + /** |
|
| 133 | + * Updates one or more new individual objects to your organization's data. |
|
| 134 | + * @param array sObjects Array of sObjects |
|
| 135 | + * @return UpdateResult |
|
| 136 | + */ |
|
| 137 | + public function update($sObjects) |
|
| 138 | + { |
|
| 139 | + $arg = new stdClass; |
|
| 140 | + foreach ($sObjects as $sObject) { |
|
| 141 | + if (isset($sObject->fields)) { |
|
| 142 | + $sObject->any = $this->_convertToAny($sObject->fields); |
|
| 143 | + } |
|
| 144 | + } |
|
| 145 | + $arg->sObjects = $sObjects; |
|
| 146 | + |
|
| 147 | + return parent::_update($arg); |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * Creates new objects and updates existing objects; uses a custom field to |
|
| 152 | + * determine the presence of existing objects. In most cases, we recommend |
|
| 153 | + * that you use upsert instead of create because upsert is idempotent. |
|
| 154 | + * Available in the API version 7.0 and later. |
|
| 155 | + * |
|
| 156 | + * @param string $ext_Id External Id |
|
| 157 | + * @param array $sObjects Array of sObjects |
|
| 158 | + * @return UpsertResult |
|
| 159 | + */ |
|
| 160 | + public function upsert($ext_Id, $sObjects) |
|
| 161 | + { |
|
| 162 | + $arg = new stdClass; |
|
| 163 | + $arg->externalIDFieldName = new \SoapVar($ext_Id, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema'); |
|
| 164 | + foreach ($sObjects as $sObject) { |
|
| 165 | + if (isset ($sObject->fields)) { |
|
| 166 | + $sObject->any = $this->_convertToAny($sObject->fields); |
|
| 167 | + } |
|
| 168 | + } |
|
| 169 | + $arg->sObjects = $sObjects; |
|
| 170 | + |
|
| 171 | + return parent::_upsert($arg); |
|
| 172 | + } |
|
| 173 | + |
|
| 174 | + /** |
|
| 175 | + * @param string $fieldList |
|
| 176 | + * @param string $sObjectType |
|
| 177 | + * @param array $ids |
|
| 178 | + * @return string |
|
| 179 | + */ |
|
| 180 | + public function retrieve($fieldList, $sObjectType, $ids) |
|
| 181 | + { |
|
| 182 | + return $this->_retrieveResult(parent::retrieve($fieldList, $sObjectType, $ids)); |
|
| 183 | + } |
|
| 184 | + |
|
| 185 | + /** |
|
| 186 | + * |
|
| 187 | + * @param mixed $response |
|
| 188 | + * @return array |
|
| 189 | + */ |
|
| 190 | + private function _retrieveResult($response) |
|
| 191 | + { |
|
| 192 | + $arr = array(); |
|
| 193 | + if (is_array($response)) { |
|
| 194 | + foreach ($response as $r) { |
|
| 195 | + $sobject = new SObject($r); |
|
| 196 | + array_push($arr, $sobject); |
|
| 197 | + } |
|
| 198 | + } else { |
|
| 199 | + $sobject = new SObject($response); |
|
| 200 | + array_push($arr, $sobject); |
|
| 201 | + } |
|
| 202 | + |
|
| 203 | + return $arr; |
|
| 204 | + } |
|
| 205 | 205 | |
| 206 | 206 | } |