[PR #1178] Fixing associations using a value-conversion type as identifiers #9237

Closed
opened 2026-01-22 16:03:40 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/1178

State: closed
Merged: No


This is a port of #1174.

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.

Remaining issue

There are 2 tests that involve OneToOne and OneToMany associations with composite ids of which one is a foreign one. When the owning side is fetched from the DB, a Proxy object is created for the inversed side. But this Proxy contains incorrect identifiers:

public $id => string(36) "12345678-9abc-def0-1234-56789abcdef0"
public $foreignEntity => string(16) "????????????????"

Those question-marks represent 16 bytes of binary data. The thing is that $foreignEntity should contain another Proxy object (or perhaps the UUID of the foreign entity, I'm not sure).

I'm at a loss here :( Hopefully someone can point me to where identity through foreign Entities is managed!

**Original Pull Request:** https://github.com/doctrine/orm/pull/1178 **State:** closed **Merged:** No --- This is a port of #1174. 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. **Remaining issue** There are 2 tests that involve OneToOne and OneToMany associations with composite ids of which one is a foreign one. When the owning side is fetched from the DB, a Proxy object is created for the inversed side. But this Proxy contains incorrect identifiers: ``` public $id => string(36) "12345678-9abc-def0-1234-56789abcdef0" public $foreignEntity => string(16) "????????????????" ``` Those question-marks represent 16 bytes of binary data. The thing is that `$foreignEntity` should contain another Proxy object (or perhaps the UUID of the foreign entity, I'm not sure). I'm at a loss here :( Hopefully someone can point me to where identity through foreign Entities is managed!
admin added the pull-request label 2026-01-22 16:03:40 +01:00
admin closed this issue 2026-01-22 16:03:40 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9237