That's it!

Thanks for your fast answer.


Am 20.08.2013 um 11:07 schrieb Markus Schall - Bergfreunde.de:

> 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>
> 
> BERGFREUNDE GmbH
> 
> Markus Schall
> 
> Bahnhofstrae 26
> Tor D, Eingang 17
> 72138 Kirchentellinsfurt
>  
> Telefon: 07121 7012-103
> Fax: 07121 7012-291
> Email: [email protected]
> 
> Web: www.bergfreunde.de
>  
> Sitz der Gesellschaft: Kirchentellinsfurt
> Amtsgericht Stuttgart, HRB 382746
> Geschftsfhrer: Martin Theben, Ronny Hhn, Matthias Gebhard
> 
>  
> 
> _______________________________________________
> dev-general mailing list
> [email protected]
> http://dir.gmane.org/gmane.comp.php.oxid.general

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

Reply via email to