Good morning,

in the model oxreview.php is a protected function _insert() which always write 
the current datetime before insert a new object to database:

protected function _insert()
{
    // set oxcreate
    $this->oxreviews__oxcreate = new oxField(date( 'Y-m-d H:i:s', 
oxRegistry::get("oxUtilsDate")->getTime() ));
    return parent::_insert();
}

You have two possibilities:

1. After $oReview->save() you have to set the create date you want and then 
save again
2. Overwrite the overview.php class and the protected function _insert()

protected function _insert()
{
    // set oxcreate
    if (!$this->oxreviews__oxcreate->value) {
        $this->oxreviews__oxcreate = new oxField(date( 'Y-m-d H:i:s', 
oxRegistry::get("oxUtilsDate")->getTime() ));
    }
    return oxBase::_insert();
}

Best regards,
Markus

 Original Message processed by David.fx12  
[oxid-dev-general] oxcreate (20-Aug-2013 9:58)
From:   Daniel Leicht
To:[email protected]


Good morning List,

i have a problem with inserting reviews into the database in Oxid PE 
4.5.9_43186.

It all works fine with creating and saving the model but the oxcreate-field.

This line: 
$oReview->oxreviews__oxcreate = new oxField(date('Y-m-d H:i:s', $iTime));

seems to be ignored because in database i get the current time of the 
insertation.

Someone knows how to fix this?

Thanks,

Daniel Leicht
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

<<image001[1].gif>>

_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to