We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Is it a conceptual error on documentation?

Studing about relationship in the phalcon documentation I saw that the modeling relationship made between Robots and parts used the many to many approach.

It allows two robots have the same specific part like this. For example Robot A and Robot B will share the Part A. A mother can have many children, but a children have just one specific mother. One robot have many parts(children), but I cant use one specific part(children) for two robots.

So, If I'm not wrong the correct conceptual relationship is one-to-many.

https://docs.phalcon.io/en/latest/reference/model-relationships.html

What you want is called many to many. Then one specific part can be use with two robots.



1.9k

It depends how you organize database. if each part in database table is specific, ie. have own serial number than each part can belong to one robot, but even in that case relation is one to one, but not as you mention one to many