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

Christian Müller christian.mueller at typo3.org
Mon Jun 3 18:28:06 CEST 2013



On 03.06.13 17:58, Xavier Perseguers wrote:
> 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.

It should also work to set the properties in the constructor, the you
can immediately access the values.

Cheers,
Christian




More information about the TYPO3-project-typo3v4mvc mailing list