[TYPO3-mvc] [Extbase] Get tstamp / crdate right after persist

Xavier Perseguers xavier at typo3.org
Mon Jun 3 17:58:06 CEST 2013


Hi,

Patrick Schriner wrote:
> Hi,
> 
> I guess you are right - these properties are not set correctly:
> 
> http://api.typo3.org/typo3cms/45/html/class_tx___extbase___persistence___backend.html#af0f9e5de728278d6cc3e1e000c8667e7
> 
> 
> Only the "uid" is refreshed immediately.
> 
> I once had a similar problem and could not find a way to force-refresh
> that tstamp or crdate.
> 
> The best thing you can do is to redirect to a different action passing
> the new object as an argument - as this will trigger a new mapping (from
> the database) the tstamp and crdate will be correct.

That's the "clean" way but I would simply go for using
$GLOBALS['EXEC_TIME'] (timestamp) or the corresponding DateTime(...)
value because internally the date is nothing magic and is set to this
value anyway.

-- 
Xavier Perseguers
Release Manager TYPO3 4.6

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org



More information about the TYPO3-project-typo3v4mvc mailing list