/** * @param bool $upsert * @param bool $refresh * @return Bronto_Api_DeliveryGroup_Row */ public function save($upsert = true, $refresh = false) { if (!$upsert) { parent::_save(false, $refresh); } try { parent::_save(true, $refresh); } catch (Bronto_Api_DeliveryGroup_Exception $e) { $this->getApi()->throwException($e); } return $this; }
/** * @param bool $upsert Ignored * @param bool $refresh * @return Bronto_Api_Conversion_Row */ public function save($upsert = null, $refresh = false) { /** * If the _cleanData array is empty, * this is an ADD of a new row. * Otherwise it is an UPDATE. */ if (empty($this->_cleanData)) { parent::_save(false, $refresh); } else { throw new Bronto_Api_Row_Exception(sprintf("Cannot update a %s record.", $this->getApiObject()->getName())); } return $this; }
/** * @param bool $upsert * @param bool $refresh * @return Bronto_Api_Contact_Row */ public function save($upsert = true, $refresh = false) { try { parent::_save($upsert, $refresh); } catch (Bronto_Api_Contact_Exception $e) { if ($e->getCode() === Bronto_Api_Contact_Exception::ALREADY_EXISTS) { $this->_refresh(); } else { $e->appendToMessage("(Email: {$this->email})"); $this->getApi()->throwException($e); } } return $this; }
/** * @param bool $upsert * @param bool $refresh * @return Bronto_Api_ContentTag_Row */ public function save($upsert = true, $refresh = false) { if (!$upsert) { parent::_save(false, $refresh); } try { parent::_save(true, $refresh); } catch (Bronto_Api_ContentTag_Exception $e) { if ($e->getCode() === Bronto_Api_ContentTag_Exception::MESSAGE_EXISTS) { $this->_refresh(); } else { $this->getApi()->throwException($e); } } return $this; }
/** * @param bool $upsert * @param bool $refresh * @return Bronto_Api_Field_Row */ public function save($upsert = true, $refresh = false) { if (!$upsert) { parent::_save(false, $refresh); } try { parent::_save(true, $refresh); } catch (Bronto_Api_Field_Exception $e) { if ($e->getCode() === Bronto_Api_Field_Exception::ALREADY_EXISTS) { $this->_refresh(); } else { $e->appendToMessage("(Name: {$this->name})"); $this->getApi()->throwException($e); } } return $this; }
/** * @param bool $upsert Ignored * @param bool $refresh * @return Bronto_Api_Delivery_Row */ public function save($upsert = null, $refresh = false) { parent::_save(false, $refresh); return $this; }