I'm writing own Hydrator implementation which transform entity to array.

To prevent recursive calls (and extra SQL queries) 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

This will *NOT* call additional SQL query:

$user=$query->getFirstResult()
$user->getAddress() 


*At the next DQL query  'u.address' association will be NOT loaded:*

SELECT u FROM User u 

This *WILL* call additional SQL query:

$user=$query->getFirstResult()
$user->getAddress() 

-----------

So, is it possible to check association something like 
$em->isAssociationLoaded($user,'address') ?

-- 
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.

Reply via email to