• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do you setup relationships with DMZ using 3 data tables and a single join table?

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?

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.

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 )?

Yes, this is exactly how it works.

Please consider implementing my hack (but probably in a much nicer way) for future releases of DMZ :-)

Please create an issue on http://bitbucket.org/wanwizard/datamapper/issues, with a link to this thread, so I won't forget it...

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.