mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Can't use readonly class because of doctrine proxies #7504
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 @vincent-philippe on GitHub (May 12, 2025).
Bug Report
Summary
I've got a blocking issue while trying to use a class which is a readonly class.
I just can't use it since doctrine has auto-generated a Proxy for this class which is not readonly.
That's because the PROXY_CLASS_TEMPLATE does not manage readonly class.
Current behavior
Error ⚠
Generated proxy is such as :
Expected behavior
No error ✔
Generated proxy is such as :
How to reproduce
In Symfony environment it's possible to define a configuration (in dev only) to auto generate proxy class.
To generate the proxy, check the
doctrine.orm.auto_generate_proxy_classes: true.You can reproduce the issue easyli create a class such as :
The generated proxy will be
@vincent-philippe commented on GitHub (May 19, 2025):
up !
maybe there's a workaround ?
@vincent-philippe commented on GitHub (May 22, 2025):
up !
maybe there's a workaround ?