join operator in relations (added in 1.1.3)

Hello everyone!

I’ve tried to find some info about new ‘join’ operator available since 1.1.3 version and I’v got no success with it. I guess it work similar to CDbCriteria’s join… ok it even throws no error when I use it like this:

'owners'=>array(self::MANY_MANY, 'User', 'user_smi(smi_id, user_id)',

                                                     'join'=>'LEFT JOIN user_smi ON user_smi.user_id="owners".id',


But how should I get access to appended properties then? Related property ‘owners’ is still filled with users array.

PS: Yeah… The goal is to get additional fields from user_smi that mostly used for MANY_MANY link.


Is it a stupid question or nobody knows the answer? :(

I’m not saying I know this for sure but I thought I’d still share my thoughts.

Wasn’t the alias t supposed to be used for the table in question, instead of user_smi.user_id=“owners”.id try (assuming that it’s the User model that this relation in defined in).

I’ve tryed that but it also doesn’t work. It even throw an error opposed to the variant with “owners” alias. When I set it as shown above there are no errors until i tried to put the columns from joined table to select. Honestly I have no idea how it may work, because of that the related object structure depends on the AR that used as reference - User in my case… So using of join here may have no sense if only there is not a way to modify the related object’s map.