Re: Ubdate HABTM and hasMany

2009-08-21 Thread Luke
Hi delocalizer, Thank you very much for your hint. You are absolutley right, I had an issue with the set up of the array. I now got it all to work, finally after 2 weeks I have to say. So for everyone who got the same problem, the array for the hasMany needs to look like this: [Recipe] => Array

Re: Ubdate HABTM and hasMany

2009-08-15 Thread delocalizer
Hi Luke, Yes the problem is that your data array is not in the right format. The manual is pretty clear on the hasMany format (for your ingredients) ... (http://book.cakephp.org/view/75/Saving-Your-Data) but the format for the habtm model is not so obvious... if you are attaching multiple subcateg

Re: Ubdate HABTM and hasMany

2009-08-14 Thread Luke
Hi, Sorry that I have to get back again. I am still hanging on this issue. recipe HABTM subcategories recipe hasMany ingredients My $this->data array Array ( [Recipe] => Array ( [id] => 6 [RecipeUIED] => [recipe_name] => Testname )

Re: Ubdate HABTM and hasMany

2009-08-12 Thread Luke
Hi, i have to get back to this topic, since I still have not found the solution. When I print out the $this->data array, i get the below. So now not forget, recipe HABTM subcategories recipe hasMany ingredients Array ( [Recipe] => Array ( [id] => 6 [RecipeUI

Re: Ubdate HABTM and hasMany

2009-08-07 Thread Persivo Cunha
Suppose that you have any validation, in your saveAll, you have to chance your this->data. First, if you used save, the correct is save ($this->data), and not $this->data['Recipe']. As you are using saveAll, your this->data must have similar to this below $this->data = array( 0 => array(Recipe

Ubdate HABTM and hasMany

2009-08-07 Thread Luke
Hi, I have a form to add recipes to a database. I have got a HABTM Relationship and a hasMany. recipe HABTM subcategories recipe hasMany ingredients In my controller I using the following: $this->Recipe->saveAll($this->data['Recipe']) This updates my Recipe table with the HABTM Relationship.