I'm developing my first Joomla component and it has been very hard to find proper documentation, so basically I've been checking core components to see how they get things done and try to apply the same method in my component.
However I cannot find how to save related tables. For example, let's say I have three tables:
Users
id,username, other_relevant_columns
Roles
id,rolename, other_relevant_columns
UsersRoles
user_id, role_id other_relevant_columns
When I create a new user, I need to specify which roles the user has and basically I have no idea where to add this code. Do I need to create a custom save method in order to achieve this? Where?
Also, how to display this information? I would like to display a group of checkboxes with all the roles that an user can have but I guess I cannot achieve this using the xml file to generate forms (because I need to load those values from the database and also need to retrieve the values in order to check/uncheck the checkboxes)
PS: Keep in mind that these are only example tables. I'm not actually implementing a user-roles functionality.