-
Notifications
You must be signed in to change notification settings - Fork 103
The default objectManagerLoader doesn't work when the entity has an embedded field. #254
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
Comments
For my Expedition entity this line https://github.com/phpstan/phpstan-doctrine/blob/master/src/Type/Doctrine/ObjectMetadataResolver.php#L181 returns null. (but not for others entities) After some dump, I discovered I ends here https://github.com/phpstan/phpstan-doctrine/blob/master/src/Type/Doctrine/ObjectMetadataResolver.php#L120 With the exception message
But there is no need for identifier https://www.doctrine-project.org/projects/doctrine-orm/en/2.11/tutorials/embeddables.html I think there is something to improve in the |
Adding
to the Phpstan metadatafactory solve the issue. Would you agree with this @ondrejmirtes ? |
That just seems like a workaround. Does this work when you provide |
I use both ORM and ODM on my project. To debug this, I simply run
in my symfony project. The first I ended up in the
When the call is made by the phpstan factory, So I find out that the |
Ok, so I found why. Everything is done by the line
In the MappingDriverChain, the code is
and Doctrine is doing I tried changing the code to
but it doesn't work, I get another error. But changing it to
solve the issue for me, because I use Annotation IMHO ; it will just break for people relying on Attribute since the driver won't be use. |
This should work: 5fa8fef Thanks. |
Indeed, it works for me. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Since #253, the metadata is resolved without the need of an objectManagerLoader.
It works well, but I have the following issue:
report an error
getRepository
is considered as anEntityRepository
instead ofExpeditionRepository
.Seems like that as soon as I remove the field
from the Expedition entity, it works well.
The text was updated successfully, but these errors were encountered: