[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.