-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Public readonly properties are unset in Proxy's constructor #9432
Comments
I'm experiencing the same. Are |
According to the docs at https://www.doctrine-project.org/projects/doctrine-orm/en/2.14/reference/architecture.html#entities - yes, as it says (emphasis mine):
|
Apparently the problem is only with See #9431 (comment) |
Are you using a recent version of Doctrine and Symfony? Since #10187 it's possible to use something else than |
Aha! Worth giving it a try. I'll let you know how it goes |
I just tried and... it fails ;) The generated constructor looks like this: public function __construct(?\Closure $initializer = null, ?\Closure $cloner = null)
{
unset($this->infoPrompt, $this->rulesPrompt);
$this->__initializer__ = $initializer;
$this->__cloner__ = $cloner;
} Which leads to:
The project is pretty new:
|
Bug Report
Summary
Public readonly properties are unset in Proxy's constructor, which results in error.
Current behavior
Cannot unset readonly property \Entity\SimpleBook::$title from scope Proxies\__CG__\Entity\SimpleBook
How to reproduce
Expected behavior
Code that generates Proxy's constructor
I dug into ProxyGenerator and here is generation of these unsets:
public readonly
properties are not tested as I see in tests.The text was updated successfully, but these errors were encountered: