[TYPO3-english] Correct use of tablenames field in mm tables

Dmitry Dulepov dmitry.dulepov at gmail.com
Thu Jun 16 09:50:41 CEST 2011


Hi!

Guillermo R. Oramas J. wrote:
> I noticed there is a field "tablenames" that is used in the mm tables.
>
> I looked for information but it appears that there is not much.
>
> I have two very similar tables that have a mm relation with a third
> table, so I created two mm tables, but I guess that with this
> "tablenames" is possible to have only one.
>
> Could someone guide me through the correct use of that field?

That field is used when you can have a relation from one record type to 
many other record types in one field.

For example, FE users has relation to FE groups. If we used MM relations 
there, it would be one record type and table names is not necessary.

Now imagine you have a shop and user has a wishlist. Goods are in different 
tables depending on the good type. But the wish list must be able to 
reference any good. So you need table names in the MM table to know what 
good it is. If there were no table names, you would have to have a separate 
MM table for each good type, which is not good if you want to add a new 
type or do efficient selects.

-- 
Dmitry "itoldyou" Dulepov
TYPO3 core&security team member
E-mail: dmitry.dulepov at typo3.org
Web: http://dmitry-dulepov.com/



More information about the TYPO3-english mailing list