/** * save * * Save the collection to the backend (SOAP API) * * @access public * @return void */ public function save() { $data = array(); $result = null; if (count($this->data) === 0) { return true; } try { foreach ($this->data as $rec) { $data[] = $rec->toSoapVarForSave(); } $result = ETCore::upsert($data); ETCore::evaluateSoapResult($result); return true; } catch (Exception $e) { throw new ETException(__METHOD__ . ':' . __LINE__ . '|' . $e->getMessage() . '|' . print_r($result, true)); } }
/** * Handles both insert and update depending on the need. Use this method to * avoid larget numbers of errors from the soap api if records do not yet * exist. * * Required properties: EmailAddress (and SubscriberKey, if that feature is * enabled for your account) * * @return boolean * @throws Exception */ public function save() { $this->checkRequiredProperties($this->requiredProperties); $this->checkRequiredAttributes(); $objects = array($this->makeSoapVar()); $result = ETCore::upsert($objects); ETCore::evaluateSoapResult($result); $this->clearModified(); return true; }