[TYPO3-mvc] How to implement a selectfield/SPLobjectArray containing different object types?

Franz Koch typo3.RemoveForMessage at elements-net.de
Tue Dec 22 14:24:10 CET 2009


Hi,

I'm trying to build up my first extBase/fluid extension and 
unfortunately started with a quite complex one. But as this extension 
has to be highly flexible and extend-able for future additions I decided 
to use DDD and extBase/fluid for that.

Before I ask my question, let me explain you what the extension is 
about. My extension has the aim to display and search for articles of 
various catalogs. The catalogs consist of pages having articles/products 
assigned, and those pages also have a certain category assigned. So I 
can search for articles within a certain category by checking the 
category of the page the articles are on.
So I got 3 objects/entities so far (catalog,page,article) and one 
valueObject (category). That should be correct so far I hope - if not, 
please teach me.

My problem is now, that there are not only articles that can be assigned 
to a page, but also other content elements (like article-sets and in 
future probably more). And now I don't know how I should handle this. My 
idea was now to add a property "content" (type array?) to my page 
objects and let it contain any of the needed content elements - so 
speaking in TCEforms a group-field where different tables are allowed to 
be selected.

But how to correctly implement this in the extBase way? Should I add a 
method "getContentElements" to my page model and do all the magic there 
by calling a repository (which one to use btw - a pageRepository with a 
according method?).
Or should I better use a dedicated SPLobjectArray for each contentType?


I'm kind a lost in this and need your advice. Thanks for help.

-- 
kind regards,
Franz Koch

---------------------------------------------------
PayPal-Account: 'paypal _at_ elements-net _dot_ de'
---------------------------------------------------


More information about the TYPO3-project-typo3v4mvc mailing list