mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Possible relationship mixup #6410
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 @dompie on GitHub (Feb 25, 2020).
Bug Report
Summary
Two bidirectional OneToMany relationships are mixed up after loading the the entity from the inverse side.
Current behavior
Create three Company objects.
Set Company2 and Company3 as Suppliers for Company1 in a bidirectional OneToMany relationship.
Leave customers for Company1 empty.
Flush && Clear
Load Company1 and see that it has relationship to 2 Customers and no Suppliers .
Seel https://github.com/dompie/doctrine-issue for more details and showcase.
How to reproduce
See for Entities: https://github.com/dompie/doctrine-issue/tree/master/src/Entity for the entities.
See for app: https://github.com/dompie/doctrine-issue/blob/master/src/Command/RunCommand.php
Expected behavior
When calling
Company->getSuppliers(), the previously added CustomerSupplierRelations should be returned there instead of onCompany->getCustomers()@dompie commented on GitHub (Feb 28, 2020):
Issue solved, not a bug.