How do you setup relationships with DMZ using 3 data tables and a single join table? |
[eluser]WanWizard[/eluser]
I still see the dot in the join table name, what is it doing there? You're storing the junction table in a separate database? Or relations over several databases?
[eluser]sideshowbob[/eluser]
Yes, there are 2 databases involved. I have users in db1 but roles, modules and the join table(many_links) are in db2. I hope my explanation makes sense, sorry for being unclear.
[eluser]WanWizard[/eluser]
Ok, clear. That is an unsupported setup though, so if it works, fine. Can you also run queries across databases ( like $role->user->get() to fetch all users that have a specific role )?
[eluser]sideshowbob[/eluser]
Yes, this is exactly how it works. Please consider implementing my hack (but probably in a much nicer way) for future releases of DMZ :-)
[eluser]WanWizard[/eluser]
Please create an issue on http://bitbucket.org/wanwizard/datamapper/issues, with a link to this thread, so I won't forget it... |
Welcome Guest, Not a member yet? Register Sign In |