Is there a simple way to recursively hydrate all related objects when performing a query?
Let’s say I have the following tables:
Song
Composer
Century
When I do a SongPeer::doSelectJoinAll() only the related composers are hydrated, so if I then do something like $song->getComposer()->getCentury(), a new query will be performed.
I want to perform only one query to the DB so when I call $song->getComposer()->getCentury() within a loop on all my songs objects, it doesn’t end up in n additional queries.
Hope I’m clear 🙂
Thanks
Are you using Propel 1.2 ? The one with creole ?
If so, try to implement your own
doSelectJoinAllon SongPeer to manually add join on other table (like century).If you are using the latest version, you just have to explicit
joinWiththe table in your query: