mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Nested setFetchMode #7322
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 @gharlan on GitHub (Feb 13, 2024).
Originally assigned to: @beberlei on GitHub.
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
setFetchModecall does not have any effect. It would be great ifsetFetchModewould work for nested relations.Or is there any other (good) replacement for my partial query?
@beberlei commented on GitHub (Aug 20, 2024):
@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.
@JanTvrdik commented on GitHub (Oct 15, 2024):
@gharlan We've recently published a library to work around the current limitations of
setFetchModeand/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.