source/Application/Controller/Admin/NewsMain.php
public function save()
    {
        parent::save();

        $soxId = $this->getEditObjectId();
        $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
        // checkbox handling
        if (!isset($aParams['oxnews__oxactive'])) {
            $aParams['oxnews__oxactive'] = 0;
        }
        // creating fake object to save correct time value
        if (!$aParams['oxnews__oxdate']) {
            $aParams['oxnews__oxdate'] = "";
        }

        $oConvObject = new \OxidEsales\Eshop\Core\Field();
        $oConvObject->fldmax_length = 0;
        $oConvObject->fldtype = "date";
        $oConvObject->value = $aParams['oxnews__oxdate'];
        $aParams['oxnews__oxdate'] = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->convertDBDate($oConvObject, true);

        $oNews = oxNew(\OxidEsales\Eshop\Application\Model\News::class);

        if ($soxId != "-1") {
            $oNews->loadInLang($this->_iEditLang, $soxId);
        } else {
            $aParams['oxnews__oxid'] = null;
        }

        //Disable editing for derived items
        if ($oNews->isDerived()) {
            return;
        }

        //$aParams = $oNews->ConvertNameArray2Idx( $aParams);

        $oNews->setLanguage(0);
        $oNews->assign($aParams);
        $oNews->setLanguage($this->_iEditLang);
        $oNews->save();

        // set oxid if inserted
        $this->setEditObjectId($oNews->getId());
    }
public function save()
    {
        parent::save();

        $soxId = $this->getEditObjectId();
        $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
        // checkbox handling
        if (!isset($aParams['oxnews__oxactive'])) {
            $aParams['oxnews__oxactive'] = 0;
        }
        // creating fake object to save correct time value
        if (!$aParams['oxnews__oxdate']) {
            $aParams['oxnews__oxdate'] = "";
        }

        $oConvObject = new \OxidEsales\Eshop\Core\Field();
        $oConvObject->fldmax_length = 0;
        $oConvObject->fldtype = "date";
        $oConvObject->value = $aParams['oxnews__oxdate'];
        $aParams['oxnews__oxdate'] = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->convertDBDate($oConvObject, true);

        $oNews = oxNew(\OxidEsales\Eshop\Application\Model\News::class);

        if ($soxId != "-1") {
            $oNews->loadInLang($this->_iEditLang, $soxId);
        } else {
            $aParams['oxnews__oxid'] = null;
        }

        //Disable editing for derived items
        if ($oNews->isDerived()) {
            return;
        }

        //$aParams = $oNews->ConvertNameArray2Idx( $aParams);

        $oNews->setLanguage(0);
        $oNews->assign($aParams);
        $oNews->setLanguage($this->_iEditLang);
        $oNews->save();

        // set oxid if inserted
        $this->setEditObjectId($oNews->getId());
    }
public function save ( ) { parent :: save ( ) ; $ soxId = $ this -> getEditObjectId ( ) ; $ aParams = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "editval" ) ; // checkbox handling if ( ! isset ( $ aParams [ 'oxnews__oxactive' ] ) ) { $ aParams [ 'oxnews__oxactive' ] = 0 ; } // creating fake object to save correct time value if ( ! $ aParams [ 'oxnews__oxdate' ] ) { $ aParams [ 'oxnews__oxdate' ] = "" ; } $ oConvObject = new \ OxidEsales \ Eshop \ Core \ Field ( ) ; $ oConvObject -> fldmax_length = 0 ; $ oConvObject -> fldtype = "date" ; $ oConvObject -> value = $ aParams [ 'oxnews__oxdate' ] ; $ aParams [ 'oxnews__oxdate' ] = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> convertDBDate ( $ oConvObject , true ) ; $ oNews = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ News :: class ) ; if ( $ soxId != "-1" ) { $ oNews -> loadInLang ( $ this -> _iEditLang , $ soxId ) ; } else { $ aParams [ 'oxnews__oxid' ] = null ; } //Disable editing for derived items if ( $ oNews -> isDerived ( ) ) { return ; } //$aParams = $oNews->ConvertNameArray2Idx( $aParams); $ oNews -> setLanguage ( 0 ) ; $ oNews -> assign ( $ aParams ) ; $ oNews -> setLanguage ( $ this -> _iEditLang ) ; $ oNews -> save ( ) ; // set oxid if inserted $ this -> setEditObjectId ( $ oNews -> getId ( ) ) ; }
Saves news parameters changes.

@return mixed
Saves news parameters changes .