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...
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,
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
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
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
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