I know about lazy loading, but I'm writing own Hydrator implementation which transform entity to array. To prevent recursive calls I need to call getters ONLY for already loaded association.
At the next DQL query 'u.address' association will be loaded "SELECT u, a FROM User u JOIN u.address a" $user=$query->getFirstResult() So, is it possible to check something like $em->isAssociationLoaded($user,'address') ? 03.02.2015 16:23, Marco Pivetta пишет: > On 3 February 2015 at 12:48, Pavel Sokolov <[email protected] > <mailto:[email protected]>> wrote: > > Thank you for the idea. > I also want to hydrate loaded associations. > But how to be sure that association was loaded before calling getter? > > > Doctrine handles lazy-loading for getters via proxying: accessing a > getter will load the association. > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ > > -- > You received this message because you are subscribed to a topic in the > Google Groups "doctrine-user" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/doctrine-user/YL-ROcBuDKY/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at http://groups.google.com/group/doctrine-user. > For more options, visit https://groups.google.com/d/optout. -- With best regards, Pavel A. Sokolov mobile: +7(921)419-1819 skype: pavel_a_sokolov -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
