Re: Saving data to three models from one form

2009-10-29 Thread Miles J
>From what I have done, saveAll would work on HABTM relations, not the others. On Oct 29, 3:39 am, Daniel wrote: > I'm not sure that's totally correct as I'm using saveAll quite > successfully in another part of the site to create new records in two > different models. The Chapter and Path model

Re: Saving data to three models from one form

2009-10-29 Thread Daniel
I'm not sure that's totally correct as I'm using saveAll quite successfully in another part of the site to create new records in two different models. The Chapter and Path models in fact - the code I'm using for this new feature is based on it. On Oct 28, 5:15 pm, Miles J wrote: > If you are

Re: Saving data to three models from one form

2009-10-28 Thread Miles J
If you are saving date for the first time (inserting), you cannot use saveAll. The foreign keys and relations will not be set. This only works for updating, and when you do an update the IDs need to be hidden in the form somewhere. You need to do it like so: http://book.cakephp.org/view/75/Saving

Re: Saving data to three models from one form

2009-10-28 Thread Daniel
I am using saveAll: if ($this->Story->saveAll($this->data, array('validate' => 'first'))) // passed validation and successfully saved Unless you mean without the array('validate' => 'first') - in which case the validation only works for the Story model. On Oct 28, 4:58 pm, Celso wrote: > Use s

Re: Saving data to three models from one form

2009-10-28 Thread Celso
Use saveAll On 28 out, 13:19, Daniel wrote: > Hi guys, I've got a bit of a problem. Rather than type it all out > again here, is it OK if I just link to my blog with all the info: > > http://theworldofdan.co.uk/2009/10/28/problem-saving-data-to-three-mo... > > I would really appreciate it if som

Saving data to three models from one form

2009-10-28 Thread Daniel
Hi guys, I've got a bit of a problem. Rather than type it all out again here, is it OK if I just link to my blog with all the info: http://theworldofdan.co.uk/2009/10/28/problem-saving-data-to-three-models/ I would really appreciate it if someone is able to help me out with this. Thank you --~--