I have a question for HABTM experts out there. I've got a pretty
standard many:many relationship through a join table, except that I
have an additional column in the join table which I need access to.
Use this as an example:

Tables:
post (id, text)
tag (id, name)
posts_tags (post_id, tag_id, metadata)

So I've got a normal join between posts and tags, and I can easily
enough get a post and its associated tags. What I want to do, though,
is get a post, iterate its tags, and for each tag get both the tag
name and the metadata for its association with the post.

I could do an additional query to get the posts_tags row based on the
post_id and tag_id, but that's one more query and it shouldn't be
necessary, since of course Cake is already getting the join. Anyone
have a clever way of getting at the metadata from the join table?

Thanks very much.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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