/** * Updates one or more new individual objects to your organization's data. * @param array sObjects Array of sObjects * @param AssignmentRuleHeader $assignment_header is optional. Defaults to NULL * @param MruHeader $mru_header is optional. Defaults to NULL * @return UpdateResult */ public function update($sObjects, $type, $assignment_header = NULL, $mru_header = NULL) { foreach ($sObjects as &$sObject) { // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #1) $xmlStr = ''; if (isset($sObject->fieldsToNull) && is_array($sObject->fieldsToNull)) { foreach ($sObject->fieldsToNull as $fieldToNull) { $xmlStr .= '<fieldsToNull>' . $fieldToNull . '</fieldsToNull>'; } } // ------ $sObject = new SoapVar($sObject, SOAP_ENC_OBJECT, $type, $this->namespace); // FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #2) if ($xmlStr != '') { $sObject->enc_value->fieldsToNull = new SoapVar(new SoapVar($xmlStr, XSD_ANYXML), SOAP_ENC_ARRAY); } // ------ } $arg = new stdClass(); $arg->sObjects = $sObjects; return parent::_update($arg); }
/** * Updates one or more new individual objects to your organization's data. * @param array sObjects Array of sObjects * @return UpdateResult */ public function update($sObjects) { $arg = new \stdClass(); foreach ($sObjects as $sObject) { if (isset($sObject->fields)) { $sObject->any = $this->_convertToAny($sObject->fields); } } $arg->sObjects = $sObjects; return parent::_update($arg); }