Hi Daniel,

> I´m sure that $this->data['MyModel']['created'] is not set.

In your example you were not resetting the created or modified values.

> And the function create() resets any data setted in Model.

Yes and no. If you're creating a record, you should pass
$this->Model->create($data); your data, which internally resets any
behaviours, calls validation and sets the data in teh model.
You then simply call $this->Model->save(); without any params to save.
If you're updating a record, you should call $this->Model->set($data);
before save, which does the same thing. IMO the docs are a little
misleading on this point (not read up on create/set/save for a long
long time!).

When copying existing records, it's always advisable to explicitly
reset any values you want to revert to defaults, unless you've
explicitly not included those fields in the find()/read().

hth

Jon

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to