Working with Doctrine ORM, is it possible to enable automatic loading of related records when used in a getter? (without explicit leftJoins ())
I know that I can use leftJoin () to get an object with related records, but I want to avoid creating a DQL query for each object and just some automatic “prefetch” of the related records.
This is useful when you need to iterate over nested Doctrine_Records and this is exactly the same functionality as Kohana ORM via the with () statement:
http://docs.kohanaphp.com/libraries/orm#with
(It just executes the query with joins, even if you only get the “root” record with array syntax).
source
share