[TYPO3-mvc] Mapping property to a MM Relation

Dirk Rauscher dr_typo3 at itb-institut.de
Tue Oct 25 16:32:05 CEST 2011


Solved the problem...

I forgot to add the 'foreign_table' attribute in the TCA.

"foreign_table" => "tx_itbmemento_domain_model_servicepackagetemplate"

Mybe it it's because I used TYPO3 Core API documentation. In the chapter 
'group' there is no attribute 'foreign_table' listed and so I didn't add 
it. Maybe it should be added there.


Cheers, Dirk


Am 25.10.2011 13:44, schrieb Dirk Rauscher:
> Hi there,
>
> my Tx_Myext_Domain_Model_Customer class extends the class
> Tx_Extbase_Domain_Model_FrondendUser with 3 additional properties.
>
> The property 'service' is an object of type Tx_Myext_Domain_Model_Service.
>
> In TCA I declared the additional fields to fe_users.
> The property 'service' is declared as a MM-Relation.
>
> "tx_itbmemento_servicepackage" => Array (
> "exclude" => 1,
> "label" => "Service",
> "config" => Array (
> "type" => "group",
> "internal_type" => "db",
> "allowed" => "tx_itbmemento_domain_model_servicepackagetemplate",
> "MM" => 'tx_itbmemento_fe_users_servicepackagetemplate_mm',
> "multiple" => 0,
> "minitems" => 1,
> "maxitems" => 1,
> "size" => 1,
> ),
> ),
>
>
> In TS the mapping is included:
>
> Tx_ItbMemento_Domain_Model_Customer {
> mapping {
> tableName = fe_users
> columns {
> tx_itbmemento_agb.mapOnProperty = agbAccepted
> tx_itbmemento_agb_date.mapOnProperty = agbAcceptedDate
> tx_itbmemento_servicepackage.mapOnProperty = servicepackage
> }
> }
> }
>
>
> When I retrieve an Tx_Myext_Domain_Model_Customer Object from DB
> everything is loaded but the property 'servicepackage'.
> I get a SQL error that lacks of a table name where servicepackages are
> stored:
>
>
>
> Where did I forget to supply information about the missing table name?
> Or isn't it possible to get the object the way I did it?
> Any hint is highly appreciated! Thanks a lot
>
> Dirk



More information about the TYPO3-project-typo3v4mvc mailing list