-
Notifications
You must be signed in to change notification settings - Fork 121
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
Update DoctrineHelper #143
Update DoctrineHelper #143
Conversation
1b445ff
to
8cbbf4c
Compare
It's not a duplicate of |
But we can improve this behavior with this implementation : https://github.com/api-platform/core/blob/master/src/Util/ClassInfoTrait.php#L38 |
I said duplicate because the code inside DoctrineHelper is exactly the same the one is inside Doctrine-> ClassUtils, so if it's deprecated for Doctrine .. it's deprecated also for this project. In my implementation, I simply remove DoctrineHelper and used the deprecated solution, which is Ocramius suggested the right replacement strategy: Don't know about the API-Platform solution. But why using that solution instead of the ProxyManager one? |
That correct for the duplicate but not for the deprecated for the project, it allows us to detach ourselves from doctrine depreciation and to be able to have compatibility with several versions without deprecated. The replacement suggested by Ocramius, it's a good alternative but adds a hard dependency. So the good way would be to read the metadata with the EntityManager like this doctrine/common#867 :
But i seems there is a problem with doctrine odm, so we need to integration like Api-Platform to be compatible with both proxy markers and without hard dependency :
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@p365labs I prefer the ApiPlatform's approach of the problem for the same reasons as the ones discussed by @maxhelias
Could you please update your PR accordingly?
thnk you @DamienHarper & @maxhelias thank u for the clarification, yep for sure! I'll do it in the next couple of days. |
8cbbf4c
to
00e8c55
Compare
0d3514e
to
a2905ec
Compare
Hi! I've updated the PR implementing the solution from ApiPlatform and referencing the authors. |
a2905ec
to
31eef44
Compare
31eef44
to
d8ef73c
Compare
d8ef73c
to
83b2cec
Compare
@DamienHarper & @maxhelias Otherwise I need to find a way to identify which ORM or ODM version is using...which is a bit weird to do. |
@p365labs I'm afraid it's a leftover from the past :) You can remove it from |
tests done! I've added some more tests and tested the Proxy use cases. I've also updated the PR title. |
remove DoctrineHelper as it's a duplicate of Doctrine Common ClassUtils,
Have a look a this discussion and this is the class which will substitute [the Common ClassUtils]
(https://github.com/Ocramius/ProxyManager/blob/addb7d39c990d3d2299315f0200e78ebe658cd7a/src/ProxyManager/Inflector/ClassNameInflector.php#L41)