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

Martin Kutschker masi-no at spam-typo3.org
Thu Jan 7 12:15:04 CET 2010


Franz Koch schrieb:
> 
> 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.

Doing the SQL selects and mapping should IMHO be relatively easy. But you have to make sure the
reverse mapping for persistence also works.

Masi

PS: AFAIK other multi-table relations like a "select" with "neg_foreign_table" don't work either.


More information about the TYPO3-project-typo3v4mvc mailing list