I would like to have a simple and reusable way of sharing a relations with a specific table with different models. What I would like to do is the possibility to specify a table, with a foreign key column such as "parent_id" and then associate this table/model to several models in my app. Is there a way to do this in cake, and which is the best way? I guess I would need an additional column in this table, to specify which is the table every row is linked to, e.g.:
Table1
id 0 1 2 name name0 name1 name2 ...
Table2
id 0 1 2 name name0 name1 name2 ...
Common_table:
id 0 1 ... parent_id 0 0 parent_table Table1 Table2
I hope the explanation above made sense, thanks in advance!