I've a current data model where I'm able to relabel things freely to complement CakePHP's conventions. I've got a kind of graph node, in which a node might have a random quantity of child nodes as well as an arbitrary quantity of parent nodes (uni-directional associations).
Here's the table of nodes, following CakePHP's conventions:
Table: nodes Column: node_id (INT) Column: description (TEXT)
My real question is exactly what the join table need to look like? Here's what it appears like now:
Table: nodes_nodes Column: parent_node_id (INT) Column: child_node_id (INT)
And exactly what the documentation suggests it ought to be:
Table: nodes_nodes Column: node_id (INT) Column: node_id (INT)
Observe that two column names are identical, which clearly will not work. What should both of these posts be known as? Or can CakePHP's conventions not handle this case without configuration?
As neilcrookes noted, you will find some articles about this on the internet about carrying this out in CakePHP. Here is one, using User HABTM User (buddies) for example.
For the reason that linked article, you are able to ignore everything following the User class definition discover likely to be paginating around the model.
If your node has child nodes, do individuals child nodes instantly possess the first node being a parent?
This relationship might be much like a customers to customers relationship in which the relationship symbolises the most popular 'friend' notion in internet sites. Suggest you've got a google around for user/friend data models to ascertain if that can help.