[eluser]Carmichael[/eluser]
I am using the php-activerecord ORM.
I am working on a permissions system. The system has three tables built in this way:
Code:
groups
id|name
1 |admin
permissions
id|permission|category
1 | create | user
2 | edit | user
permissions_map
group_id|permission_id
1 | 1
1 | 2
I want to know how I should build the associations in the Permission class.
This is what I want it to do:
Get group permissions by group id (from permissions_map)
Get group information (name) by group id (from groups)
Get permissions by group id (from permissions)