Open gharlan opened 8 months ago
@gharlan I am assigning this to myself to take a look what we can do as soon as I have time, probably around the Doctrine Hackathon in October.
@gharlan We've recently published a library to work around the current limitations of setFetchMode
and/or the need to write custom partial queries (which are now working again, yeah!) that should work for your use case.
This is how fetching nested entitiets from your example would look with the EntityPreloader.
$mails = $query->getResult();
$preloader = new EntityPreloader($entityManager);
$recipients = $preloader->preload($mails, 'recipients');
$preloader->preload($recipients, 'user');
Feature Request
Summary
At the moment I'm using partial queries for fetching nested entities:
Now I'm trying to convert this to
setFetchMode
(https://github.com/doctrine/orm/pull/8391) because partial queries are removed in v3. I've tried this:The second
setFetchMode
call does not have any effect. It would be great ifsetFetchMode
would work for nested relations.Or is there any other (good) replacement for my partial query?