Closed podorozhny closed 7 years ago
Or maybe someone has already implemented it? :)
We started integrating this library with the ORM, but eventually gave up due to the complexity needed for the task. Will likely give it a stab if I have a couple of free months :-\
Meanwhile, closing here. The dependency is Doctrine implementing GeneratedHydrator, not the other way around.
Hello, @Ocramius.
I'm wondering what you think about implementing Doctrine GeneratedHydrator. I mean something like
GeneratedHydrator extends \Doctrine\ORM\Internal\Hydration\AbstractHydrator
.What do you think, is this a good idea? Will it have any advantages over ObjectHydrator?
Or maybe someone has already implemented it? :)
My dream is to learn how to fetch & hydrate & serialize large collections of entities with doctrine for an acceptable time.
For example I have these entities:
In my JSON API REST controller I want to do something like that:
With few thousands posts in database this action will take SECONDS to generate JSON from database data and the only reason here will be complicated doctrine object hydration. Switching to ArrayHydrator will reduce it to a couple of hundreds milliseconds, but I can't use it because entities is not a simple DTOs (look at
getTags
andgetNameProcessedWithSomeKindOfMagic
method examples). Database data denormalization and ArrayHydrator usage is also a pretty good solution in big collections API, but I wonder if its not the only solution.My apologies for the fact that this longread is not directly related to your library, this is a really big problem for me and I will be infinitely glad for your ideas on this issue.
Thanks!