[TYPO3-mvc] Problems using 1..N relationships within STI

Hauke Stange hstange at eheundjanneck.de
Tue Jul 12 10:54:57 CEST 2011


Hello there.

I want to use single table inheritance and map a one to many
relationship between some objects stored in it.

I think the STI is configured properly but somehow I don't get the
relationships running.

There a three classes involved. I have a so called 'Basisklasse' which
is the superclass from 'UnterklasseFoo' and 'UnterklasseBar'. The
superclass is not used directly but only the subclasses.

Both subclasses can be successfully created and modified via the list
view in the backend. But additionally to that I need to get the one to
many mapping between this classes running and here it seems 'lies the
dog burried'. :-)

My 'UnterklasseFoo' has a property 'barObjects' to hold a list of
'UnterklasseBar' objects which is defined as
Tx_Extbase_Persistence_ObjectStorage<Tx_xxxx_Domain_Model_UnterklasseBar>.

The corresponding 'UnterklasseBar' has a property 'fooReference' defined
as Tx_xxxx_Domain_Model_UnterklasseFoo.

I've added those fields to the DB table as well.

Does somebody somehow understand what I'm trying to do and could please
give me some hints?

My Code...

Basisklasse: http://pastie.org/2200913
UnterklasseFoo: http://pastie.org/2200918
UnterklasseBar: http://pastie.org/2200925

TCA: http://pastie.org/2200958

Schema: http://pastie.org/2200930
TypoScript: http://pastie.org/2200928


Regards,

Hauke Stange



More information about the TYPO3-project-typo3v4mvc mailing list