Hi Brenton I think we need help from a HABTM expert :-)
>From what I understand, storing extra info in the join table is commonly done. However, I think storing multiple join table rows for the same join so that you can store even more data is going beyond the existing HABTM design. Technically speaking, I guess you ought to create an extra table and then make a three-way join which I've heard some people call 'ternary'. I believe you would make extra models and associations depending on how you need to manage the data. This thread may help: http://groups.google.com/group/cake-php/browse_frm/thread/7ee52fa005dd4f49 Best wishes On Oct 11, 10:21 am, Brenton B <[EMAIL PROTECTED]> wrote: > Hey villas, > > Thanks for that. > I had read through a bunch of those and I have put in the ID field and > experimented with the 'unique' functionality but was still confused > why the core is restricting potentially useful rows. The logic in that > chunk of code doesn't seem to fit. I mean if the result from the query > is the reason for looping through it and stripping out duplicates, > then obviously there's something faulty with returning duplicates. > It's quite inefficient as well, regardless if we're talking about > fractions of seconds, inefficiency is inefficiency. > I'm just saying at first glance it seems like a band-aid solution to a > (currently unknown) problem. > > On Oct 10, 3:29 pm, villas <[EMAIL PROTECTED]> wrote: > > > Hi Brenton, > > > Saving extra fields in the join table has been discussed a few times > > in the group. > > > From what I understand, it seems you should add an ID field to the > > join table and then start accessing the join table through models in > > other ways than simply relying on the basic HABTM functionality. > > Reading these links might help: > > >http://groups.google.com/group/cake-php/browse_thread/thread/bf91d27a...... > > See Mariano's article: tinyurl.com/4kbe9q > > > I also notice you are using the default 'unique' => true in your > > setup. Maybe you should also consider experimenting with that because > > it overwrites previous entries but I'm not sure if it's relevant to > > your situation. For ease of reference, the book section describing > > this is here:http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM > > > Hope this helps a little. > > > On Oct 10, 10:26 pm, Brenton B <[EMAIL PROTECTED]> wrote: > > > > Basically, on a HABTM relationship, it's not returning all rows > > > because it's filtering out for unique ids ... why?!?! > > > > In my mind, it's not logical to eliminate valid rows when returning > > > them, there's no comments explaining why this is being done so I'm > > > asking here. > > > I ran into an issue where I want rows because that's what HABTM is > > > supposed to do, but it's not ... > > > > Not sure how else i can explain it ... > > > > PS. See link to original discussion. > > > > On Oct 10, 2:01 pm, Gwoo <[EMAIL PROTECTED]> wrote: > > > > > You have not provided enough information for anyone to help. You need > > > > to say what you are expecting, show the results of that. Pasting core > > > > code is not of any help without that information. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
