Of course you can realize it manually afterwards. Everithing can be prepared for it.
You create first your linking tables with Cook, I mean you create a table with 2 FK only, pointing to the 2 main tables to link.
And then, you must code inside your component, it require a medium level of programming.
I cannot exlain you clearly now, I hope you will receive some help from the users, or may wait a little bit for more explainations.
Here a road map :
- A html control send you ($_POST) and array of selected values. these values are the ids of the others items.
- You must know the id of the concerned current item to link, so it can work only AFTER that the item has been stored (created or updated)
- Once the storing of the main item form succeeds, you can continue the process, wich will consist to 'link' this current item to the other received ids from the other table (N:N)
- Create a function in the current model which recieve the arrays of values to link. for instance : $model->linkProducts($cids)
- This function in the model deals with SQL and does the job you should be able to write. It consist in writting in the linking table the id of the 2 items to link.
This functionality should be able to create, delete, or update every link. A very good exercice.
The whole process is called by the controller, in the save() function :
- First call the save() functionality of the model
- Second if it succeeds : Send the ids[] to your custom function for linking in the model.
A little bit of work, and this is the reason why it take time to integrate in Cook native.