mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Property promotion not working correctly with associations/proxies #7096
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 @delolmo on GitHub (Jan 25, 2023).
Bug Report
Summary
Given that associations are loaded through proxies, when using constructor promotion in entities, PHP will throw an error when trying to access a property of the proxy object.
Current behavior
The stated above.
How to reproduce
Given these entities (i.e.):
One would expect this code to work:
But the following error is thrown:
Expected behavior
If possible, no error should be thrown and properties should be initialized when trying to access the proxy object.
@mpdude commented on GitHub (Jan 26, 2023):
Is this related to #10385?
@delolmo commented on GitHub (Jan 27, 2023):
Seems like it, sorry! Closing the issue.
@delolmo commented on GitHub (Nov 20, 2023):
I have revisited this issue and I am still having the same problem, despite #10385 being supposedly fixed. I am currently working with doctrine
2.17.1.