From b81209c2780724f0ec65c04b6115e2b552dd6ee4 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Tue, 13 Jan 2015 01:43:12 +0100 Subject: [PATCH] #470 DDC-54 DDC-3005 - documenting `postLoad` and `Doctrine\ORM\AbstractQuery#iterate()` partial incompatibility --- docs/en/reference/events.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/en/reference/events.rst b/docs/en/reference/events.rst index 2762e5fc7..65acd2466 100644 --- a/docs/en/reference/events.rst +++ b/docs/en/reference/events.rst @@ -184,6 +184,14 @@ the life-time of their registered entities. invoked, after all references to entities have been removed from the unit of work. This event is not a lifecycle callback. +.. warning:: + + Note that, when using ``Doctrine\ORM\AbstractQuery#iterate()``, ``postLoad`` + events will be executed immediately after objects are being hydrated, and therefore + associations are not guaranteed to be initialized. It is not safe to combine + usage of ``Doctrine\ORM\AbstractQuery#iterate()`` and ``postLoad`` event + handlers. + .. warning:: Note that the postRemove event or any events triggered after an entity removal