[TYPO3-dev] Eager fetching vs. joins

Dirk Ho dirk_studivz at web.de
Fri Aug 29 21:17:49 CEST 2014


Dear group,

my forum extension is growing from day to day a little bit more. What I 
now want to do is the following: I have several categories which contain 
0 to n forums which contain 0 to n topics and posts.

Now I would like to create the initial page like this:

CATEGORY 1
FORUM 1 | 15 Topics | Last Post 29.09.2014 by Dirk
FORUM 2 | 3 Topics | Last Post 29.09.2014 by Dirk
CATEGORY 2
FORUM 3 | 0 Posts | No posts yet

When I google for eager loading I guess I always find solutions for 
FLOW, but not for Extbase? Nevertheless my clever book does not show me 
at all how to join using Extbase. Or is there only a possibility to join 
with raw sql?

I guess in my case I would need eager loading for the Categories to 
fetch all forums as well (because I want to show all of them), but for 
my forums I should iterate over each forum and send a query that counts 
the topics and fetches the last post that was created in one of the 
forum's topics?!

Can you help me and give me an example how I would solve such a problem 
in a "high-performance" way?

Thanks and best wishes,

Dirk



More information about the TYPO3-dev mailing list