/**
  * Adds one or more new individual objects to your organization's data.
  * @param array $sObjects Array of one or more sObjects (up to 200) to create.
  * @return SaveResult
  */
 public function create($sObjects)
 {
     $arg = new stdClass();
     foreach ($sObjects as $sObject) {
         if (isset($sObject->fields)) {
             $sObject->any = $this->_convertToAny($sObject->fields);
         }
     }
     $arg->sObjects = $sObjects;
     return parent::_create($arg);
 }
 /**
  * Adds one or more new individual objects to your organization's data.
  * @param array $sObjects Array of one or more sObjects (up to 200) to create.
  * @param AssignmentRuleHeader $assignment_header is optional.  Defaults to NULL
  * @param MruHeader $mru_header is optional.  Defaults to NULL
  * @return SaveResult
  */
 public function create($sObjects, $type)
 {
     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 = $sObjects;
     return parent::_create(new SoapParam($arg, "sObjects"));
 }