Did you somehow find a solution ? I have an exactly the same problem right now and I don't see any solution..
On 14 Lut, 18:26, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have setup where a user "picks" a "game" ... > > User hasMany Picks > Picks belongsTo Game (and user) > > I want to return ALL 'Games' with 'MyPick' (doesn't matter if I picked > the game or not). It would be nice to see the hasOne relationship > carry an "on" param that does the following ... > > $this->Game->bindModel(array( > 'hasOne' => array( > 'MyPick' => array( > 'className' => 'PicksUsers', // NOT a habtm relationship, > btw > 'foreignKey' => 'game_id', > 'on' => "MyPick.user_id='1'", > // 'conditions' => "PicksUsers.user_id='1'", // can't do > this because it only will return games I picked > ), > ), > )); > $this->Game->findAll(); > > Result (sql).. > SELECT * FROM games ...LEFTJOINpicks_users As MyPick ON > (MyPick.game_id = Game.id AND MyPick.user_id='1') ... > > As you can see, now all games will be returned ... > Should I open a ticket? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---