What does “privately owned” mean (as seen in Doctrine's official documentation)?

In the doctrine documentation, I read the following: "When using the orphanRemoval = true parameter, Doctrine makes the assumption that the objects are privately owned and will NOT be reused by other objects."

here is a link where you can find the offer in its context. official doctrine documentation

Can someone give me an example of personal objects in ManyToMany relationships between objects?

0
symfony entity doctrine
Dec 15 '14 at 1:50
source share
1 answer

Imagine that you save some user settings in the Settings object, which is attached to the User object through a one-to-many or one-to-one relationship, the Settings object will not, you can say that Settings is in the private ownership of User and becomes orphaned if User is deleted, orphanRemoval=true prevent this. deleting Settings when the "mother" User object is deleted.

Some other SO questions you might find interesting:

  • stack overflow
  • stack overflow

For many-to-many relationships, you can use orphanRemoval for such relationships, and Doctrine will simply remove attached objects, even if they are still attached to other objects. Please note that even if this option works with many-to-many relationships, it is not officially documented for such relationships:

I don’t think there is any example of a many-to-many private organization, or it won’t be many-to-many, but Doctrine just makes an assumption he will continue to delete attached objects in any case.

+1
Dec 15 '14 at 4:39
source share



All Articles