You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Ocramius and others, I wonder what your opinion is about metadata for hydrator generation.
For example, I'd like to see integration for hydrator strategies or nesting hydrators, but it seems to me that you'd need to have some kind of metadata about how to map the array to the object. Thinks like, for example:
DateTime hydration. What format is the date in?
Nesting hydrators. Have ['bar' => ['quu' => 'quuz']] arary, hydrate to a Foo object that has a Bar object as property. The FooHydrator would need to call (or inline) the BarHydrator.
Array hydration. How to hydrate or extract an array of objects.
I think some kind of metadata is required to support these use cases, but I don't think you'd want to replicate a large part of e.g. JMS/Serializer. The point of generated hydrators is to be very, very fast.
What would be a sane way to go about this?
The text was updated successfully, but these errors were encountered:
By creating a simpler and specific AST for hydrators only, this would allow to get rid of the nikic/parser dependency, and remove a lot of complexity from the existing code, at the cost of having to maintain its own AST - but I think that, if the goal of this API is to generate complex hydrator trees for specific needs, it would worth it. It would also allow to do things such as a bridge to Symfony property info component (that would work both ways actually).
@Ocramius and others, I wonder what your opinion is about metadata for hydrator generation.
For example, I'd like to see integration for hydrator strategies or nesting hydrators, but it seems to me that you'd need to have some kind of metadata about how to map the array to the object. Thinks like, for example:
['bar' => ['quu' => 'quuz']]
arary, hydrate to a Foo object that has a Bar object as property. The FooHydrator would need to call (or inline) the BarHydrator.I think some kind of metadata is required to support these use cases, but I don't think you'd want to replicate a large part of e.g. JMS/Serializer. The point of generated hydrators is to be very, very fast.
What would be a sane way to go about this?
The text was updated successfully, but these errors were encountered: