Self-Referential ManyToMany Convention in CakePHP

谁说我不能喝 提交于 2019-12-01 01:09:30

As neilcrookes noted, there are some articles on this on the web about doing this in CakePHP. Here is one of them, using User HABTM User (friends) as an example.

In that linked article, you can ignore everything after the User class definition if you aren't going to be paginating on the model.

If a node has child nodes, do those child nodes automatically have the first node as a parent?

This relationship may be similar to a users to users relationship where the relationship symbolises the common 'friend' notion in social networks. Suggest you have a google around for user/friend data models to see if that helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!