[TYPO3-mvc] Single table inheritance (extbase)

Kristian Nygård Jensen nygaard at mocsystems.com
Thu Dec 17 15:44:53 CET 2009


Hi,
I have four classes: abstract Location, Hall, WorkOfArt and Exhibition.
Hall, WorkOfArt and Exhibition all extend Location, and have the 
properties: title and description.
Halls contains artworks.
Exhibition contain a mix of halls and artworks.

I would prefer to persist the three classes: Hall, WorkOfArt and 
Exhibition In the same tx_..._location table and distinguish the record 
types by a location_type column.
The reason for this is that I then in my tca could write:

$TCA['tx_smkfloorplan_domain_model_location'] = array(
...
'columns' => array(
   //Mix of halls and artworks
   'locations' => array(
     ...
     'config' => array(
       'foreign_table' => 'tx_..._location'

My problem is then with the DataMapper, since the the objectType is 
given by the repository.

Do you have any suggestions for solving my problem apart from extending 
the DataMapper and overwriting mapSingleRow. How would you solve the 
mixed list situation, with the default "concrete table" strategy?

Best regards

Kristian Nygaard Jensen


More information about the TYPO3-project-typo3v4mvc mailing list