-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
[RFC]: Process parent properties in the ReflectionHydrator. #114
Comments
…ied. Signed-off-by: Ian Foulds <[email protected]>
…ied. Signed-off-by: Ian Foulds <[email protected]>
Have you checked the Doctrine integration project for hydrators? |
@froschdesign Many thanks for pointing me to that, I've not seen that before and I'll try some tests with it. I assume that it deals with proxied entities but I'll find out soon enough. I think my PR is still valid for the ReflectionHydrator. |
That's interesting @froschdesign, but my hydrator is used in Symfony projects and based on the Laminas hydrator as it's parent. I use it to hydrate model classes from Request objects (form data) which usually contain Doctrine entities and other DTOs. I need t look at the Laminas framework in details to see what it offers. |
…ied. Signed-off-by: Ian Foulds <[email protected]>
RFC
Provide a means to hydrate private properties of parent classes.
Background
Currently the hydrator gets the class properties using ReflectionClass. This is fine if the class does not inherit from other classes, or if all the properties are public. However if the properties are private then only the instantiated class properties are enumerated. For Doctrine entities that are associations, and other cases using inherited getters and private properties, Doctrine returns a proxied class and not the original entity. When the hydrator enumerates the properties of the class it just gets the properties of the proxy and not the base entity.
Considerations
There will be no impact on current use of the hydrator as fetching parent properties is optional.
Proposal(s)
The text was updated successfully, but these errors were encountered: