This may have been covered somewhere else but I can’t find it. I have a single table called Valuelist where I have columns (value, module, field, name) so I have one location and one application that manages all valuelists. The Value is what is stored on the application. For example:
Value Module Field Name
1 Post Status Pending
2 Post Status Active
3 Comment Type Social
When setting up the relations, I have to join to more than one value. I currently have this in my Comment model:
‘rStatus’=>array(self::BELONGS_TO, ‘Valuelist’, ‘’, ‘on’=>‘value=status’, ‘joinType’=>‘INNER JOIN’, ‘alias’=>‘rStatus’)
My question is, how do I write that relation to have the ‘on’ to include 3 criteria? Does there need to be a relation on Valuelist to do a MANY_MANY join? I can’t find an example anywhere.