Re: last created, last modified

2008-03-04 Thread Brad Beattie
Yeah, I see the same behaviour. The modified field is only updated if it isn't already set in the model's data. Building a work-around with beforeSave or beforeValidates won't work as model.php's save function builds its created/modified/updated information before these callbacks. Grr...

Re: last created, last modified

2008-03-04 Thread Brad Beattie
Hrm. Found a solution. In your app_model.php, add a function as follows: function save($data = null, $validate = true, $fieldList = array()) { unset($this-data[$this-alias]['modified']); return parent::save($data, $validate,

Re: last created, last modified

2008-01-31 Thread grigri
The fields 'modified', 'created' and 'updated' are managed internally within Model::save(). It doesn't matter where you call it from, if you call Model::save() then those fields will work automagically. Note that calling Model::updateAll() will not update any fields other than the ones you

Re: last created, last modified

2008-01-31 Thread Siegfried Hirsch
Hello grigri, 2008/1/31, grigri [EMAIL PROTECTED]: The fields 'modified', 'created' and 'updated' are managed internally within Model::save(). It doesn't matter where you call it from, if you call Model::save() then those fields will work automagically. Note that calling

Re: last created, last modified

2008-01-30 Thread manish
Yes, this is managed by Cake itself. Check: http://tempdocs.cakephp.org/#TOC62105 On Jan 31, 9:07 am, Raistlin Majere [EMAIL PROTECTED] wrote: I do not know how the last created date and the last modified date are passed to my database. I do not have a hidden created date input nor a hidden

Re: last created, last modified

2008-01-30 Thread Siegfried Hirsch
2008/1/31, manish [EMAIL PROTECTED]: Yes, this is managed by Cake itself. Check: http://tempdocs.cakephp.org/#TOC62105 What about cake Shells? If I use $model-save() in a Shell, do they created and modified fields also get updated ? I have just the problem and it looks like they are not