mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
PostLoad event on fetch joined entities - Lifecycle Callback not firing #5612
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 @stoccc on GitHub (Jul 21, 2017).
Originally assigned to: @Ocramius on GitHub.
I have a problem with a Lifecycle Callback of Doctrine ORM: the callback is not executed on fetch-joined entities, while it's regularly executed on entities that are lazy-loaded.
Is there a bug in the ObjectHydrator, or it is a lack of documentation about that?
See this question on stackoverflow
@Ocramius commented on GitHub (Jul 21, 2017):
Any load operation should trigger postLoad events, so this is a bug. Can
you submit a test case to be added to our test suite?
On 21 Jul 2017 09:28, "stoccc" notifications@github.com wrote:
@stoccc commented on GitHub (Jul 21, 2017):
I'm not so expert, I hope I did the right thing!
@Ocramius commented on GitHub (Jul 21, 2017):
@stoccc test looks good, thanks!
@stoccc commented on GitHub (Jul 21, 2017):
@Ocramius
I fixed the patch, and now all tests pass correctly.
I think you should remove Bug label, but you gained a test case :)
The problem was in my application, I was using in PostLoad of the root entity some informations setted in PostLoad of the fetchjoined entities, but certainly no one can guarantee me that one PostLoad is executed before or after some other PostLoad.
I close, thanks for your time.