Re: HABTM saving problem - solved (I think)

2009-07-20 Thread seb
Thanks for posting the solution. Well I've got the same problem! But it looks like you have the fix. However I can't quite get my head around it because in your example you refer to $category in $category["CandidateItem"]["CandidateItem"][$count] = this->Category- >CandidateItem->getLastInsertI

Re: HABTM saving problem - solved (I think)

2009-07-14 Thread cc_humbry
Finally sorted this for anyone else who has the same problem... iterate over my array and save each item individually. Get each id of inserted row and add to new data array and then save Category. This then creates the associations in the link table. foreac

HABTM saving problem

2009-07-14 Thread cc_humbry
Hi, Can't figure this one out, not for the want of trying though. Models involved are Category, CandidateItem which are associated in each model as HABTM. I created a temp baked project to see if the association definition was correct and it appears to be. In my categories_controller I have a me

Re: HABTM saving problem

2007-04-25 Thread [EMAIL PROTECTED]
Can you post an example please? When I do $this->Post->save it only saves Post info and not related Tags ... Thanks in advance .. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this gr

Re: HABTM saving problem

2007-03-27 Thread feelexit
I got it work now --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For

Re: HABTM saving problem

2007-03-27 Thread [EMAIL PROTECTED]
feelexit, in order to save the data to tags table you must have in the data returned ($this->data) data relating to the Tag model like this data['Tag'['Tag'] = array ( 'id' => '1' , 'id' => '2'...) where ['Tag']['Tag'] contains an array of id's corresponding to tag id's. You can find more info o

Re: HABTM saving problem

2007-03-27 Thread feelexit
another question is , in the posts with tags example, when I am doing save, only save post table or posts_tags will be saved as well ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to t

HABTM saving problem

2007-03-27 Thread feelexit
I have 3 tables tags resources resources_tags in my controller, i use " print_r ($this->data); " to print out data structure Array ( [Resource] => Array ( [title] => hhh [description] => [user_id] => 1 ) ) it only has data for Resource, there's no data for Tag. here's my HTML code.