yiisoft/yii — Issue #406: CTimeStampBehavior columns not set immediately after save()
Author: mikehaertl
Created: 2012-02-26 13:38:44+00:00
State: open

I'd like to come back to this google code issue:
http://code.google.com/p/yii/issues/detail?id=2104

If you save a record and have `CTimestampBehavior` attached, it will by default set the timestamp columns to `CDbExpression`s. So if you read out this value in the same request you'll not get what you expect.

I know, that we can circumvent this by either refreshing the AR or by setting `timestampExpression`. I consider both to be a workaround. The behavior should work transparently and not require so much extra consideration or configuration.

A solid fix would be, to set the right value on the PHP side, at least for those column types which can be autodetected (`DATE`, `DATETIME` and `TIMESTAMP`).