mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #5858] Exporters should only inspect joinColumns for owning side in bi-directional OneToOne
#9758
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?
Original Pull Request: https://github.com/doctrine/orm/pull/5858
State: closed
Merged: Yes
After having run the YamlExporter in one of our projects there was a weird behavior when a bi-directional OneToOne association was defined.
I managed to replicate the behavior with adding an inversed bi-directional mapping to the test metadata:
Doctrine.Tests.ORM.Tools.Export.User.dcm.ymlSo the problem is that the
joinColumnarray index is not set for the inversed side but will still be inspected. After applying the check for$associationMapping['isOwningSide'] === true ? $associationMapping['joinColumns'] : array();the export works as expected.Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.ymlEDIT
Same applies to the
PhpExporterwhen duplicating the test case to the test metadata: