[TYPO3-dev] The extbase dilemma

Peter Niederlag typo3-list at niekom.de
Fri May 20 12:43:26 CEST 2011


Hello,

Am 20.05.2011 12:15, schrieb Mathias Schreiber [wmdb]:
> Am 20.05.11 11:20, schrieb Peter Niederlag:
[...]
> If we stick to the blog example:
> 100 blogs with 100 posts each and 100 comments per post.
> You want to display the latest comment per blog.
> IIRC this would result in at least 100 queries, right?
> Or I fiddle around with custom queries which then in return does not let
> me use persistence or does it?

That's a very nice and perfect use case, also you most likely would only 
want to display the last 10 comments!

I think this can probably not be done properly (without loading way to 
much data) via the current query implementation and does need some 
"Hirnschmalz"(brainpower). ;)

I have solved a similar limitation via a trigger which saves the needed 
data (blog.latestComment, blog.lastCommentDate) in the blog table so I 
can easily query it. Code for the trigger is loaded via 
class.ext_update.php.

now you query 10 blogs by sorting via latestCommentDate-> Voila, 
performant solution. :->

Needs some knowledge but can "easily" be done. ;)

[...]

Greets,
Peter
-- 
Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *




More information about the TYPO3-dev mailing list