Is it possible to cache each entites (including lazy-loaded)?

Now simple access to entity never use cache:
$provider=$em->find(Provider',100); 


To use cache I should write:

$provider=$em->getRepository('Provider')->createQueryBuilder('p')
    ->where("p.id=?1")
    ->setParameter(1,100)
    ->getQuery()
    ->useResultCache(true)
    ->getOneOrNullResult();


Also cache does not works for lazy-loaded enitites.

So, is there some way to use cache for entire repository?

There are some discussions here: 
http://stackoverflow.com/questions/15661296/doctrine-2-and-orm-how-to-cache-every-query-for-some-entity

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