-
-
Notifications
You must be signed in to change notification settings - Fork 586
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
Support new doctrine ODM proxy objects #1139
Conversation
3b02ad8
to
92e2955
Compare
92e2955
to
415b2e6
Compare
@@ -53,7 +53,7 @@ public function onPreSerialize(PreSerializeEvent $event): void | |||
} | |||
|
|||
if (($this->skipVirtualTypeInit && $virtualType) || | |||
(!$object instanceof Proxy && !$object instanceof ORMProxy) | |||
(!$object instanceof Proxy && !$object instanceof LazyLoadingInterface) |
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.
is ORMProxy
still considered? does this work also with ocramius/proxy-manager: 1.x
?
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.
For ORMProxy
I found that it implements Proxy
interface and think that it could be dropped at all because if !$object instanceof Proxy
then it is obviously !$object instanceof ORMProxy
. So I replaced it with LazyLoadingInterface
For ocramius/proxy-manager
you are right. It should work with 1.x and even with 0.1.0 version (very first). Should I lower version in composer.json?
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.
For ORMProxy I found that it implements Proxy interface and think that it could be dropped at all because if !$object instanceof Proxy then it is obviously !$object instanceof ORMProxy. So I replaced it with LazyLoadingInterface
I remember that, just if i'm not wrong wasn't so for all proxy-mamager versions
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.
I remember that, just if i'm not wrong wasn't so for all proxy-mamager versions
Yes, proxy-manager has LaLoIn in all version, but I'm wondering how to reflect this in composer.json?
"ocramius/proxy-manager": "*"
or "ocramius/proxy-manager": "^0.1|^1.0|^2.0"
?
For ORMProxy, I have double checked with --prefer-lowest
and Doctrine\ORM\Proxy\Proxy
is instance of Doctrine\Common\Proxy\Proxy
. Do you think it is still worth checking?
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.
I think if the tests are green with #1139 (comment), then we are good to go
Co-Authored-By: Asmir Mustafic <[email protected]>
Thanks |
As from version 2.0
doctrine/mongodb-odm
usesocramius/proxy-manager
serializer needs to handleLazyLoadingInterface
same as doctrine proxy objects.