I think having a separate model for your join table is okay in this case.
And perhaps it's a must as you have a third foreign key involved in that
join table.

On Tue, Nov 4, 2008 at 6:00 PM, Adriano Varoli Piazza <[EMAIL PROTECTED]>wrote:

>
> I'm developing an app where I have two tables, let's call them items
> and people, where the relationship between them is HABTM. Plus, the
> individual relationships have extra info: this person is related to
> this item with a 'description' field.
> E.g.:
>
> ------------
> people:
> id
> other fields
> ------------
> items:
> id
> other fields
> ------------
> items_people:
> id
> person_id
> item_id
> description (varchar)
> ------------
>
> In the 'worst' case, the join table holds another foreign key to a
> table which holds extra info:
> ------------
> items_people_bis:
> id
> person_id
> item_id
> concept_id
> -----------
> concepts:
> id
> other fields
> -----------
>
> Now, I know this is convoluted, but I wanted to know which is the best
> way / standard practice to represent such a thing in cake? I've tried
> with a simple habtm association in the model, seen that I could use
> 'with', also tried using hasmany on both models involved, and making
> an extra model for the join table, but I'm still not sure about how to
> go. I'd appreciate any help.
>
> Thanks in advance
> Adriano
> >
>


-- 
Anupom Syam
http://syamantics.com/

--~--~---------~--~----~------------~-------~--~----~
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