[PR #11857] Support entities with association column names that conflict with a field name #13302

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

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

State: closed
Merged: No


If an entity is defined such that it has a field $a based on a column c, and an association field $b based on a column a, hydration will fail. This is because the data array that is created during hydration uses field names for keys except for associations. For associations it uses the column names, leading to a conflict.

This PR adds a prefix to the column-valued array keys to avoid clashes. The prefix uses characters that could not occur in a field name so it should be safe for all possible field and column names.

**Original Pull Request:** https://github.com/doctrine/orm/pull/11857 **State:** closed **Merged:** No --- If an entity is defined such that it has a field `$a` based on a column `c`, and an association field `$b` based on a column `a`, hydration will fail. This is because the data array that is created during hydration uses field names for keys except for associations. For associations it uses the column names, leading to a conflict. This PR adds a prefix to the column-valued array keys to avoid clashes. The prefix uses characters that could not occur in a field name so it should be safe for all possible field and column names.
admin added the pull-request label 2026-01-22 16:16:46 +01:00
admin closed this issue 2026-01-22 16:16:46 +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#13302