[Typo3-dev] database relations in TYPO3

JoH info at cybercraft.de
Wed Nov 16 14:40:14 CET 2005


>>>> You cannot put multiple relations in int field. So, blog is for
>>>> multiple relations (though I would prefer text). And I think blog
>>>> is used in case of single relations just to simplify the code
>>>> (i.e. handle all types of relations in one place).
>>>>
>>> I sometimes change them from blob to text in phhmyadmin just to
>>> read the content.
>>> There are however typo3 functions to work with these 'virtual'
>>> relations. Can't remember them....
>>> I think it's planned for typo3 version 5 to start with real database
>>> relations?
>>> Kicksters does have some functionality for that already called MM
>>> relation tables.
>>
>> Currently I've only seen the BLOBs contain comma separated lists of
>> uid's in extensions I build. These are easy to fetch and then use
>> explode() on them to populate an array with the individual related
>> UID's. Works like a charm for me, but I may be missing something..
>>
> The advantage of having real database relations is that in general
> retreiving large data structures is faster
> then calling the RDBM over and over again.
> Also you can easely make relations in such a way that you can delete
> releated record automaticly,
> or use triggers to set a 'deleted' bit on a field. It keeps the
> database consistend.
> However, the kickstarter is capable of create MM tables to create mm
> relations if needed.
> I didn't see that it's creates a real relation between tables
> though..... Joe Celko made some exellent books about this subject.

AFAIK it is used at least in tt_products, where you have sys_products_orders
containing the order information and sys_products_orders_mm_tt_products for
the relations to the different items ordered by the client.
The only disavantage in this case is, that you will get only the current
item state and not the state the item had while the order was finished. So
in this case the MM relation doesn't make sense IMHO.

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.openbc.com/go/invuid/Jo_Hasenau






More information about the TYPO3-dev mailing list