mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
partials and shared objects between queries #5415
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 @eventhorizonpl on GitHub (Feb 13, 2017).
Originally assigned to: @Ocramius on GitHub.
Hi,
I don't know if it's a bug or optimization feature.
Lets say that I've got a Post entity and User entity.
In one query I do something like this:
->select('partial p.{id,slug,title}, partial pu.{id,username}') ->from('Post', 'p') ->leftJoin('p.user', 'pu')and I've got another query in the same action and I do something like this
->select('partial u.{id,username,slug}') ->from('User', 'u')The problem is that in result list of second query I'm getting a 1 user without slug. This object looks like it was taken from Post query.
I guess that it's caused by some internal doctrine optimization. But I don't know if it's a feature or a bug.
Without using partial queries you will not notice any problem.
Best regards,
Michal