source/Application/Model/User.php
public function getNewsSubscription()
    {
        if ($this->_oNewsSubscription !== null) {
            return $this->_oNewsSubscription;
        }

        $this->_oNewsSubscription = oxNew(\OxidEsales\Eshop\Application\Model\NewsSubscribed::class);

        // if subscription object is not set yet - we should create one
        if (!$this->_oNewsSubscription->loadFromUserId($this->getId())) {
            if (!$this->_oNewsSubscription->loadFromEmail($this->oxuser__oxusername->value)) {
                // no subscription defined yet - creating one
                $this->_oNewsSubscription->oxnewssubscribed__oxuserid = new \OxidEsales\Eshop\Core\Field($this->getId(), \OxidEsales\Eshop\Core\Field::T_RAW);
                $this->_oNewsSubscription->oxnewssubscribed__oxemail = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxusername->value, \OxidEsales\Eshop\Core\Field::T_RAW);
                $this->_oNewsSubscription->oxnewssubscribed__oxsal = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxsal->value, \OxidEsales\Eshop\Core\Field::T_RAW);
                $this->_oNewsSubscription->oxnewssubscribed__oxfname = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxfname->value, \OxidEsales\Eshop\Core\Field::T_RAW);
                $this->_oNewsSubscription->oxnewssubscribed__oxlname = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxlname->value, \OxidEsales\Eshop\Core\Field::T_RAW);
            }
        }

        return $this->_oNewsSubscription;
    }
public function getNewsSubscription()
    {
        if ($this->_oNewsSubscription !== null) {
            return $this->_oNewsSubscription;
        }

        $this->_oNewsSubscription = oxNew(\OxidEsales\Eshop\Application\Model\NewsSubscribed::class);

        // if subscription object is not set yet - we should create one
        if (!$this->_oNewsSubscription->loadFromUserId($this->getId())) {
            if (!$this->_oNewsSubscription->loadFromEmail($this->oxuser__oxusername->value)) {
                // no subscription defined yet - creating one
                $this->_oNewsSubscription->oxnewssubscribed__oxuserid = new \OxidEsales\Eshop\Core\Field($this->getId(), \OxidEsales\Eshop\Core\Field::T_RAW);
                $this->_oNewsSubscription->oxnewssubscribed__oxemail = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxusername->value, \OxidEsales\Eshop\Core\Field::T_RAW);
                $this->_oNewsSubscription->oxnewssubscribed__oxsal = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxsal->value, \OxidEsales\Eshop\Core\Field::T_RAW);
                $this->_oNewsSubscription->oxnewssubscribed__oxfname = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxfname->value, \OxidEsales\Eshop\Core\Field::T_RAW);
                $this->_oNewsSubscription->oxnewssubscribed__oxlname = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxlname->value, \OxidEsales\Eshop\Core\Field::T_RAW);
            }
        }

        return $this->_oNewsSubscription;
    }
public function getNewsSubscription ( ) { if ( $ this -> _oNewsSubscription !== null ) { return $ this -> _oNewsSubscription ; } $ this -> _oNewsSubscription = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ NewsSubscribed :: class ) ; // if subscription object is not set yet - we should create one if ( ! $ this -> _oNewsSubscription -> loadFromUserId ( $ this -> getId ( ) ) ) { if ( ! $ this -> _oNewsSubscription -> loadFromEmail ( $ this -> oxuser__oxusername -> value ) ) { // no subscription defined yet - creating one $ this -> _oNewsSubscription -> oxnewssubscribed__oxuserid = new \ OxidEsales \ Eshop \ Core \ Field ( $ this -> getId ( ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ this -> _oNewsSubscription -> oxnewssubscribed__oxemail = new \ OxidEsales \ Eshop \ Core \ Field ( $ this -> oxuser__oxusername -> value , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ this -> _oNewsSubscription -> oxnewssubscribed__oxsal = new \ OxidEsales \ Eshop \ Core \ Field ( $ this -> oxuser__oxsal -> value , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ this -> _oNewsSubscription -> oxnewssubscribed__oxfname = new \ OxidEsales \ Eshop \ Core \ Field ( $ this -> oxuser__oxfname -> value , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ this -> _oNewsSubscription -> oxnewssubscribed__oxlname = new \ OxidEsales \ Eshop \ Core \ Field ( $ this -> oxuser__oxlname -> value , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; } } return $ this -> _oNewsSubscription ; }
Returns user newsletter subscription controller object

@return object oxnewssubscribed
Returns user newsletter subscription controller object