mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #1174] Fix associations with a custom type for identifiers #9233
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/1174
State: closed
Merged: No
I was running an experiment using a custom DBAL type, which converts a UUID string (in PHP) to 16 bytes binary string (in SQL) and vice versa, as identifier for a couple of entities. I noticed some associations weren't loaded correctly. This PR attempts to fix that issue.
I've included several tests:
During the "ManyToMany association ..." tests I discovered the join-table wasn't populated properly. The columns were filled with the UUID string (in stead of the 16 bytes binary string). This has been addressed as well.
I've included these tests to verify that:
When applying a fix for the "Loading a OneToMany association with composite identifier including a foreign one" test, the "Loading a OneToOne association with composite identifier including a foreign one" test started to produce an error.
This is due to the Proxy object containing a 16 bytes binary string (in stead of the UUID string) for the foreign identifier.
Also the "Removing entities from a ManyToMany association with composite identifier including a foreign one" tests keeps failing because there's a 16 bytes binary string (in stead of the UUID string) for the foreign identifier in the Collection.
I have a feeling these last 2 cases are not because of an issue in the Persisters, but because of an issue in the Hydrators. Unfortunately I don't know where to begin looking :(
I could really need some help finishing this up!