DataMapper ORM relations problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: DataMapper ORM relations problem (/showthread.php?tid=44445) |
DataMapper ORM relations problem - El Forum - 08-15-2011 [eluser]Unknown[/eluser] Hi. I've started testing DataMapper ORM and ran into a little problem with relations. I have following tables and relations. Code: class Bet extends DataMapper { I can get users winning bets like this. Code: $u = $this->login_manager->get_user();//Returns current logged in user I would like to get game related to that winning_bet. I have only managed to get this by turning auto_populate to true in Winning_bet model. This applies to every relation I have in that model and it will cause problems when I only want specific data to be populated. Also I have user in every has_one relation that is auto-populated which causes user to be fetched again. So what would be appropriate way to get game related to Winning_bet? I'm sure there is pretty simple solution for my problem but at the moment I can't figure out any solution. |