source/Application/Model/News.php
protected function _insert()
    {
        if (!$this->oxnews__oxdate || \OxidEsales\Eshop\Core\Registry::getUtilsDate()->isEmptyDate($this->oxnews__oxdate->value)) {
            // if date field is empty, assigning current date
            $this->oxnews__oxdate = new \OxidEsales\Eshop\Core\Field(date('Y-m-d'));
        } else {
            $this->oxnews__oxdate = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->oxnews__oxdate->value, true));
        }

        return parent::_insert();
    }
protected function _insert()
    {
        if (!$this->oxnews__oxdate || \OxidEsales\Eshop\Core\Registry::getUtilsDate()->isEmptyDate($this->oxnews__oxdate->value)) {
            // if date field is empty, assigning current date
            $this->oxnews__oxdate = new \OxidEsales\Eshop\Core\Field(date('Y-m-d'));
        } else {
            $this->oxnews__oxdate = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->oxnews__oxdate->value, true));
        }

        return parent::_insert();
    }
protected function _insert ( ) { if ( ! $ this -> oxnews__oxdate || \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> isEmptyDate ( $ this -> oxnews__oxdate -> value ) ) { // if date field is empty, assigning current date $ this -> oxnews__oxdate = new \ OxidEsales \ Eshop \ Core \ Field ( date ( 'Y-m-d' ) ) ; } else { $ this -> oxnews__oxdate = new \ OxidEsales \ Eshop \ Core \ Field ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> formatDBDate ( $ this -> oxnews__oxdate -> value , true ) ) ; } return parent :: _insert ( ) ; }
Inserts object details to DB, returns true on success.

@return bool
Inserts object details to DB returns true on success .