I was wondering if any module developers have been faced with representing m-n relationships between nodes and how this was accomplished. I'm currently faced with the task of mapping a user interface on top of a dozen or so distince data types (tables), each of which is somehow related to the others (through foreign key relationships).
I've seen how the project.module has projects that contain issue nodes and release nodes, but that seems like a much more laborious setup than anything I need. The table structures would look something like the following:
parent_table:
nid int,
parent_stuff varchar(255),
other_stuff varchar(255)
child1_table:
nid int,
parent_nid int, // foreign key into parent_table
child1_data varchar(255),
child1_more_data date
child2_table:
nid int,
child1_nid int, // foreign key into child1_table
child2_other_data varchar(255),
child2_yet_more_data int
Each node of all types would exist on its own, but nodes of type child1 would have to be associated with a parent node, and nodes of type child2 would have to be associated with a child1 node.
Even if the child1 and child2 types didn't need to exist (as distinct nodes) outside of the scope of the parent node, there would be multiple child1 records for each parent record. Does anybody else do this sort of thing using the node system? I have some ideas for how to deal with this, but they're all kinda clumsy and/or very code intensive. Generally, there isn't much that needs to be done with each data structure other than providing edit facilities and rendering it for viewing. If I thought I could do this using flexinode.module, I certainly would.