mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Problem with ObjectHydrator #5091
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 @raziel057 on GitHub (Apr 12, 2016).
Originally assigned to: @Ocramius on GitHub.
I've just noticed this weird behaviour:
Considering I have an entity "area" which contains a collection of "badges".
With "area" ID1 contains (Badge ID2, Badge ID3, Badge ID4)
But when I get the badge entity, I only the badge id 2 in collection. Is it a known behavior (cache in Object hydratator) or a bug? For me, as the query is different, we can't reuse the same object, so it seems to be an issue but can you please confirm.
Example:
Result:
@Ocramius commented on GitHub (Apr 12, 2016):
You are filtering on a fetch-join (
aandbare both selected), which will break hydration.While this is supported, it is a risky operations, and you shouldn't do it, ever.
The problem is that
aentries will only have a subset ofbentries it actually references, and by hydrating the results this way you are also keeping this inconsistent state in memory.See also http://stackoverflow.com/questions/13603054/doctrine-fetch-join
@raziel057 commented on GitHub (Apr 12, 2016):
Ok thanks for your reply.