[TYPO3-mvc] extbase: implementing something simmilar to languageOverlay

Jochen Rau jochen.rau at typoplanet.de
Tue Dec 22 23:54:02 CET 2009


Hi.

schrieb Franz Koch:
> sorry for spamming this list with tons of questions, but I'm really lost
> with my currently quite complex extension I try to create with extbase.

That’s no spam as long as you don't come up with the something to 
enlarge something ;-)

[...]

> My plan was to completely move that data to a external table and fetch
> the relevant description with a JOIN LEFT, so that the data is part of
> the article itself. But does this work? What's the suggested way to do
> this, so that I can use methods like "$article->getDescription" and
> don't have to do something like
> "$article->getDataHolder()->getDescription".

A clean way to implement this would be to have an abstract class 
AbstractComment and some classes extending it like CatalogComment, 
FlyerComment. Inside the ArticleRepository you can implement the logic 
to fetch and build your Article. If the building process gets more 
complicated you might want to move it into an ArticleFactroy called by 
the ArticleRepository.

Unfortunately, you're not able to store the Comments in one table 
without building custom Queries, yet. But we're working on that feature 
(See posting "Single table inheritance").

> Or would it be better to have those fields also natively in my article
> table and do something similar like it's done with "languageOverlay" in
> traditional Typo3? If so, how to do this? Simply inside my
> articleRepository, or is there something else I need to do to make
> extbase work correctly with this? For now I don't need objectPersistency
> as no feEditing is needed.

I would not recommend overlays.

Regards
Jochen

-- 
Every nit picked is a bug fixed



More information about the TYPO3-project-typo3v4mvc mailing list