I need some help solving one issue with the models and their relations, which I assume is causing some problems when Yii needs to join two tables.
The main problem is with the table users_achievements. The correct way to do this, is to have a unique achievementID in the achievements table, but what identifies a single achievement is a (gameId, achievementID), examples: (achivement nr 1 of game A), (achievemente nr 2 of game . Thus, the table users_achievement will get this composite primary key as part of its own key.
The problem is that I don’t know how to correctly place the relations on the Models so that when joining the join is made on the correct keys.
Can anybody help me on this ?
Do I need to provide more information ? Examples ?
Thanks in advance.