41 $this->
init(
'oxnewssubscribed' );
52 public function load( $oxId )
56 if ( $this->oxnewssubscribed__oxdboptin->value == 1 ) {
57 $this->_blWasSubscribed =
true;
58 } elseif ( $this->oxnewssubscribed__oxdboptin->value == 2 ) {
59 $this->_blWasPreSubscribed =
true;
75 $sEmailAddressQuoted = $oDb->quote( $sEmailAddress );
76 $sOxId = $oDb->getOne(
"select oxid from oxnewssubscribed where oxemail = {$sEmailAddressQuoted} " );
78 return $this->
load( $sOxId );
91 $sOxId = $oDb->getOne(
"select oxid from oxnewssubscribed where oxuserid = {$oDb->quote( $sOxUserId )} and oxshopid = {$oDb->quote( $this->getConfig()->getShopId() )}" );
92 return $this->
load( $sOxId );
114 if ( ( $this->_blWasSubscribed || $this->_blWasPreSubscribed ) && !$this->oxnewssubscribed__oxdboptin->value ) {
116 $this->oxnewssubscribed__oxunsubscribed->setValue(date(
'Y-m-d H:i:s' ));
120 $aSkipSaveFieldsKeys = array_keys( $this->_aSkipSaveFields,
'oxunsubscribed' );
121 foreach ( $aSkipSaveFieldsKeys as $iSkipSaveFieldKey ) {
122 unset ( $this->_aSkipSaveFields[ $iSkipSaveFieldKey ] );
126 $this->_aSkipSaveFields[] =
'oxunsubscribed';
139 return $this->oxnewssubscribed__oxdboptin->value;
162 return $this->oxnewssubscribed__oxemailfailed->value;
185 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();