mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Proxy returns default value without initializing #5379
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 @Wilt on GitHub (Jan 12, 2017).
If we define a default value like this:
And we have a Proxy of
MyEntityinstead of an initialized entity then pulling the proxy method returns a default value without initializing the entity and resolving the actual database value.This means that the database value for
myColumnis actually holding a completely different value we got returned from our proxy without us realizing this.Since this way of defining default values is also mentioned in the documentation chapter: 3.2.2. How can I add default values to a column? we were very surprised that this issue occurred.
Are we doing something wrong here? Or is this a bug?