Get reference table information as well in MANY_MANY relation


I have MANY_MANY relation question - how can one get related information AND relation information as well?

What I mean is, I have ‘comments’ relation for a User model:




	Comment_reference::tableName().'(profile_id, comment_id)',



	'order'=>'comment.post_time DESC',


It works well if I need to get comments for a user, but i also need to have Comment_reference row information for each found comment. It’s all because each comment can be related to many users, and Comment_reference (relation table) purpose is not only to serve as foreignKey helper.

So, can it be done via AR? Please help :rolleyes:

One of the most frequent questions - please also try a forum search first (googling might be better than the built in forum search).

I know 2 solutions, here’s one:

There’s also a issue here: