42 $this->
init(
'oxnewssubscribed');
53 public function load($oxId)
57 if ($this->oxnewssubscribed__oxdboptin->value == 1) {
58 $this->_blWasSubscribed =
true;
59 } elseif ($this->oxnewssubscribed__oxdboptin->value == 2) {
60 $this->_blWasPreSubscribed =
true;
76 $sEmailAddressQuoted = $oDb->quote($sEmailAddress);
77 $sOxId = $oDb->getOne(
"select oxid from oxnewssubscribed where oxemail = {$sEmailAddressQuoted} ");
79 return $this->
load($sOxId);
92 $sOxId = $oDb->getOne(
"select oxid from oxnewssubscribed where oxuserid = {$oDb->quote($sOxUserId)} and oxshopid = {$oDb->quote($this->getConfig()->getShopId())}");
94 return $this->
load($sOxId);
117 if (($this->_blWasSubscribed || $this->_blWasPreSubscribed) && !$this->oxnewssubscribed__oxdboptin->value) {
119 $this->oxnewssubscribed__oxunsubscribed->setValue(date(
'Y-m-d H:i:s'));
123 $aSkipSaveFieldsKeys = array_keys($this->_aSkipSaveFields,
'oxunsubscribed');
124 foreach ($aSkipSaveFieldsKeys as $iSkipSaveFieldKey) {
125 unset ($this->_aSkipSaveFields[$iSkipSaveFieldKey]);
129 $this->_aSkipSaveFields[] =
'oxunsubscribed';
142 return $this->oxnewssubscribed__oxdboptin->value;
163 return $this->oxnewssubscribed__oxemailfailed->value;
184 if (
'0000-00-00 00:00:00' != $this->oxnewssubscribed__oxunsubscribed->value) {
202 if ($oUser->oxuser__oxusername->value && $this->oxnewssubscribed__oxemail->value != $oUser->oxuser__oxusername->value) {
211 return (
bool) $this->
save();