[TYPO3-mvc] mmm-relationship
Nils Blattner
nb at cabag.ch
Mon Jun 7 09:31:01 CEST 2010
Am 07.06.10 06:34, schrieb Barbara Schwarz:
> Hello
>
> I am having a hard time thinking of a proper way to implement a
> three-way relationship (mmm-relationship?). Here's the concrete case: in
> my data model I have a relationship between a company, product and role.
> For example: a company can be a producer and the distributor of a
> certain product (producer and distributor are roles). I would need to
> make something like a table company_product_role_mmm, but this exists
> only for the relationship between two entities, not three. Do you have
> any idea how to implement this?
>
> Thanks in advance,
>
> Barbara
Hi Barbara
The way standard mm-relations in TYPO3 work this is not possible directly.
Or only with dropping BE-editing and managing the tables yourself.
However alternatively I suggest the following:
Split it up in a two way relation ->
- company n : 1 roleInstance
make a helper table that takes one company and one role and thus "
instanciates the company
- roleInstance n : m product
instead of connecting the company directly you relate the roleInstance
to the product via mm-relation.
In real world terms you could say that the roleInstance is the company
acting out a specific aspect.
Hope this helped
Nils
More information about the TYPO3-project-typo3v4mvc
mailing list