/**
  * We need to check if we unsubscribe here
  *
  * @return mixed oxid on success or false on failure
  */
 protected function _update()
 {
     if (($this->_blWasSubscribed || $this->_blWasPreSubscribed) && !$this->oxnewssubscribed__oxdboptin->value) {
         // set unsubscription date
         $this->oxnewssubscribed__oxunsubscribed->setValue(date('Y-m-d H:i:s'));
         // 0001974 Same object can be called many times without requiring to renew date.
         // If so happens, it would have _aSkipSaveFields set to skip date field. So need to check and
         // release if _aSkipSaveFields are set for field oxunsubscribed.
         $aSkipSaveFieldsKeys = array_keys($this->_aSkipSaveFields, 'oxunsubscribed');
         foreach ($aSkipSaveFieldsKeys as $iSkipSaveFieldKey) {
             unset($this->_aSkipSaveFields[$iSkipSaveFieldKey]);
         }
     } else {
         // don't update date
         $this->_aSkipSaveFields[] = 'oxunsubscribed';
     }
     return parent::_update();
 }
 /**
  * Updates payment record in DB. Returns update status.
  *
  * @return bool
  */
 protected function _update()
 {
     //encode sensitive data
     if ($sValue = $this->oxuserpayments__oxvalue->value) {
         // Function is called from inside a transaction in Category::save (see ESDEV-3804 and ESDEV-3822).
         // No need to explicitly force master here.
         $database = oxDb::getDb();
         $sEncodedValue = $database->getOne("select encode( " . $database->quote($sValue) . ", '" . $this->getPaymentKey() . "' )");
         $this->oxuserpayments__oxvalue->setValue($sEncodedValue);
     }
     $blRet = parent::_update();
     //restore, as encoding was needed only for saving
     if ($sEncodedValue) {
         $this->oxuserpayments__oxvalue->setValue($sValue);
     }
     return $blRet;
 }
Exemple #3
0
 /**
  * Force update.
  *
  * @return mixed
  */
 public function update()
 {
     return parent::_update();
 }
Exemple #4
0
 /**
  * Updates payment record in DB. Returns update status.
  *
  * @return bool
  */
 protected function _update()
 {
     $oDb = oxDb::getDb();
     //encode sensitive data
     if ($sValue = $this->oxuserpayments__oxvalue->value) {
         $sEncodedValue = $oDb->getOne("select encode( " . $oDb->quote($sValue) . ", '" . $this->getPaymentKey() . "' )", false, false);
         $this->oxuserpayments__oxvalue->setValue($sEncodedValue);
     }
     $blRet = parent::_update();
     //restore, as encoding was needed only for saving
     if ($sEncodedValue) {
         $this->oxuserpayments__oxvalue->setValue($sValue);
     }
     return $blRet;
 }
Exemple #5
0
 /**
  * Update this Object into the database, this function only works on
  * the main table, it will not save any dependend tables, which might
  * be loaded through oxlist (with exception of the active language set
  * table, which will be updated).
  *
  * @throws oxObjectException Throws on failure inserting
  *
  * @return bool
  */
 protected function _update()
 {
     $blRet = parent::_update();
     if ($blRet) {
         //also update multilang table if it is separate
         $aUpdateTables = array();
         if ($this->_blEmployMultilanguage) {
             $sCoreTable = $this->getCoreTableName();
             $sLangTable = getLangTableName($sCoreTable, $this->getLanguage());
             if ($sCoreTable != $sLangTable) {
                 $aUpdateTables[] = $sLangTable;
             }
         } else {
             $aUpdateTables = $this->_getLanguageSetTables();
         }
         foreach ($aUpdateTables as $sLangTable) {
             $sUpdate = "insert into {$sLangTable} set " . $this->_getUpdateFieldsForTable($sLangTable, $this->getUseSkipSaveFields()) . " on duplicate key update " . $this->_getUpdateFieldsForTable($sLangTable);
             $blRet = (bool) oxDb::getDb()->execute($sUpdate);
         }
     }
     // currently only multilanguage objects are SEO
     // if current object is managed by SEO and SEO is ON
     if ($blRet && $this->_blIsSeoObject && $this->getUpdateSeo() && $this->isAdmin()) {
         // marks all object db entries as expired
         oxRegistry::get("oxSeoEncoder")->markAsExpired($this->getId(), null, 1, $this->getLanguage());
     }
     return $blRet;
 }
Exemple #6
0
 /**
  * Updates changed user object data to DB. Returns true on success.
  *
  * @return bool
  */
 protected function _update()
 {
     //V #M418: for not registered users, don't change boni during update
     if (!$this->oxuser__oxpassword->value && $this->oxuser__oxregister->value < 1) {
         $this->_aSkipSaveFields[] = 'oxboni';
     }
     // don't change this field
     $this->_aSkipSaveFields[] = 'oxcreate';
     if (!$this->isAdmin()) {
         $this->_aSkipSaveFields[] = 'oxcustnr';
         $this->_aSkipSaveFields[] = 'oxrights';
     }
     // updating subscription information
     if ($blUpdate = parent::_update()) {
         $this->getNewsSubscription()->updateSubscription($this);
     }
     return $blUpdate;
 }
Exemple #7
0
 /**
  * Updates object parameters to DB.
  *
  * @return null
  */
 protected function _update()
 {
     $this->_aSkipSaveFields = array('oxtimestamp', 'oxorderdate');
     $this->oxorder__oxsenddate = new oxField(oxRegistry::get("oxUtilsDate")->formatDBDate($this->oxorder__oxsenddate->value, true));
     return parent::_update();
 }
 /**
  * Updates object parameters to DB.
  *
  * @return null
  */
 protected function _update()
 {
     $this->oxorder__oxsenddate = new oxField(oxUtilsDate::getInstance()->formatDBDate($this->oxorder__oxsenddate->value, true));
     return parent::_update();
 }