Helt me with associations |
[eluser]Carmichael[/eluser]
I've three tables. Users, groups, permissions and permissions_map. Users Code: id|username|group_id Groups Code: id|name Permissions Code: id|permission Permissions_map Code: group_id|permission_id So... in the Permissions table I list all the permissions there is. In the Permissions_map table I list all permissions a group has. For example... it can look like this in Permissions map Code: group_id|permission_id And like this in Permissions Code: id|permission I wan't to be able to get the permission name from permissions by the permission id in permissions map. Code: class User extends ActiveRecord\Model I can get all the permissions a group has in permissions_map, but I wan't to get the permission name by the ids too from permissions. How do I do that?
[eluser]Aken[/eluser]
Considering this is an ActiveRecord ORM question rather than one relating to CodeIgniter itself, I would check their docs: http://www.phpactiverecord.org/projects/...sociations
[eluser]Carmichael[/eluser]
[quote author="Aken" date="1343694963"]Considering this is an ActiveRecord ORM question rather than one relating to CodeIgniter itself, I would check their docs: http://www.phpactiverecord.org/projects/...sociations[/quote] You're right. Just one question about the ORM. Can you access tables by joining them in a model or do have to create a model for each table to access data from the table?
[eluser]Aken[/eluser]
I don't know, personally - never used it. Check out their docs and forums, I'm sure you can find the answer. |
Welcome Guest, Not a member yet? Register Sign In |