mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-161: Custom Hydrator #199
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Nov 19, 2009).
Originally assigned to: @jwage on GitHub.
Jira issue originally created by user marijn:
I was wondering if it would be possible to create custom hydrators for Doctrine 2.0. If I have a look at the EntityManager#getHydrator() method it seems not. Or should I subclass the EntityManager and override the getHydrator() method?
@doctrinebot commented on GitHub (Nov 19, 2009):
Comment created by @guilhermeblanco:
Maybe we should just take the approach we did for registering types and reuse same idea in hydrators too.
Of course it'll require us to write an Interface so people can at least have an idea of what's needed and make the AbstractHydrator to implement it.
I'm +1 to include this support, since we already have it in earlier 1.X and people can surely uses it if they're not affordable with our nice hydrators.
Cheers,
@doctrinebot commented on GitHub (Nov 19, 2009):
Comment created by @jwage:
I'd like to see this in 2.0 as well too.
@doctrinebot commented on GitHub (Nov 19, 2009):
Comment created by romanb:
Scheduled for the first beta. I already have an idea on how to do this. Should be fairly easy.
@doctrinebot commented on GitHub (May 19, 2010):
Comment created by romanb:
Jon, would you want to give this a try? Custom hydrators should be registered as closures I think, since they are instantiated on demand.
@doctrinebot commented on GitHub (May 19, 2010):
Comment created by romanb:
Just another thought on the issue. Maybe it is enough to set the hydrator on a Query to use. That way we don't need additional configuration cruft.
So instead of being able to register custom "hydration modes", you can simply set a custom "hydrator" on a specific query.
@doctrinebot commented on GitHub (May 19, 2010):
Comment created by marijn:
I agree with Roman. As an added bonus: that's what people are used to from Doctrine 1
@doctrinebot commented on GitHub (May 20, 2010):
Comment created by @jwage:
How do you want to handle that roman? Another setting to set the custom query? or just allow a default hydrator that expects a string className in the EntityManager#newHydrator() method? or what were you thinking?
@doctrinebot commented on GitHub (Jun 2, 2010):
Issue was closed with resolution "Fixed"