I am looking for the highest performance way (er… best way) to timestamp records. I see that we can put custom time() login in beforeValidate or beforeSave methods or we can use the CTimestampBehavior in Zii. What are the tradeoffs of one method over another?
We are using
$entry->created = new CDbExpression('NOW()');
Would imagine it’s quicker than implementing the before* methods. Never used CTimestampBehavior, so can’t comment on that.
Anyways, if you have performance problems I’m not sure this is the place to start. Not much time spent doing this stuff.
If you just need the time without the user ID that created/updated the record then you can just set the default and update value in the database… and all will be handled automatically…