Welcome Guest, Not a member yet? Register   Sign In
How do you setup relationships with DMZ using 3 data tables and a single join table?
#1

[eluser]lilpine[/eluser]
Hi, I was wondering if anyone ever tried this and how it would be implemented. Basically I have the following db structure:
Code:
[roles]      -> [roles_users]        <- [users]
[privileges] -> [actions_privileges] <- [actions]
[modules]    -> [modules_sections]   <- [sections]
Working with these relationships in DMZ is pretty simple, no issues there.
Code:
//Using the standard
class Role extends DataMapper {
    var $has_many = array('user')
}

class User extends DataMapper {
    var $has_many = array('role')
}
However, three tables, (roles, privileges, modules) are linked to each other using a single join table (permissions):
Code:
permissions [id, role_id, privilege_id, module_id]
I'm unable to get these relationships defined in DMZ. There might be a simple solution but for the life of me I can't seem to get it.


Messages In This Thread
How do you setup relationships with DMZ using 3 data tables and a single join table? - by El Forum - 12-08-2010, 10:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB