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

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu Jan 7 11:59:36 CET 2010


Hi Jochen,

>> I'm still struggling with this last problem I've got in the concept
>> phase of my db-scheme/model. I need a way to assign various content
>> types to my page models, where "content types" are not like in TYPO3
>> based on a single table, so no single table inheritance, but can be
>> selected from different tables. So just like in the TYPO3 content
>> element "insert records", where you can select tt_content, tt_news, etc.
>
...
> Atm it is not possible to fill this ObjectStorage automatically (because
> of the lack of single table inheritance). You have to do this manually.
> You might also define an Object-Table-mapping (see
> EXT:extbase/Configuration/TypoScript/setup.txt.

as I wrote I don't need single table inheritance ATM. I was thinking 
about using a field with the TCA configuration:

'contentElements' => array(
   #...
   'config' => array(
     'type' => 'group',
     'internal_type' => 'db',
     'allowed' => 'table1,table2,table3'
     'MM' => 'tx_myExt_contentelements_mm',
   ),
)

So one single TCEform field that's storing references to various other 
tables (just like the "insert Records" CE does in Typo3 v4). Each of the 
relations is storing the ID as well as the tablename, so for extbase it 
would be possible to determin the correct model to map the record on. I 
already started digging into the dataMapper stuff and found out that 
'group' fields are not supported yet natively (but you can fool extbase 
by placing a 'foreign_table' definition in TCA, as long as you only 
refer to one table in the group field).
But in general I think this would be possible to achieve quite easily if 
one knows where to start tweaking.

> There is a related article on the FLOW3 mailing list that might help
> (not a solution for your problem, but it points you in the right
> direction).
>
> Newsgroups: flow3.general
> Subject: [FLOW3-general] Storing/Receiving Different Models with one Action
> Date: Wed, 23 Dec 2009 14:29:36 +0100
> Message-ID: <mailman.12731.1261575062.615.flow3-general at lists.typo3.org>

Thanks, I'll have a look.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list