mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #11857] Support entities with association column names that conflict with a field name #13302
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/11857
State: closed
Merged: No
If an entity is defined such that it has a field
$abased on a columnc, and an association field$bbased on a columna, 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.