mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-2585: Persisting the owning side will not set the inverse side relationship #3247
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jul 31, 2013).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user naroga:
Adding items to the owning side of a bidirectional relationship should be enough to set the items' relationship to its owner. Instead, as of now we still have to manually set both sides, be it on the entity itself or on your controller/service code.
Example:
$owning->addObject($inverse);
Doctrine should execute $inverse->setOwner($owning) when flushing $owning. Right now we have to run $owning->addObject($inverse) and $inverse->setOwner($owning) manually, which makes no sense, since Owner entity is configured to cascade persist operations.