[TYPO3-mvc] MM relation table - additional data
Franz Koch
typo3.RemoveForMessage at elements-net.de
Mon Jul 5 20:15:38 CEST 2010
Hey Dennis,
...
> What i'd like to achieve is a property related to my
> DocumentTemplateElement, thats value is written into the related
> MM_table. This property should only be set if the
> DocumentTemplateElement is fetched as child of a DocumentTemplate.
>
> Has anybody experience with this request? Have seen that Franz has
> contributed a patch, that makes the MM_match_fields available when
> writing MM_tables. But the config seems to expect the value for the
> field directly written in TCA.
>
> 'MM_match_fields' => array('outlineNumber' => 'outlineNumberValue')
That's how Typo3 is expecting it.
> Any ideas how to configure the relation that the value is feteched out
> of the DocumentTemplateElement object on runtime?
AFAIK that's not possible by using MM_match_fields - and it shouldn't be
done by that if you need logic in the relation.
If you need metaData/logic in your relations then it sounds like you
need a intermediate object and not just a mm-table - so your mm-table
becomes a object with 3 properties: documentTemplateElement,
documentTemplate and outlineNumber. Can you give such a intermediate
object holding the onlineNumber a name in your domain?
I recently had a case, where a company can be assigned to several
groups. This was like in your case a simple mm relation. Some time later
I had the requirement to be able to assign a department of the company
to each group relation, that will be used to display contact
informations on the website. So I had to find a way to do this in a nice
and clean way that fits in my domain. In the end I came up with the
solution, that this relation is actually like a "membership", so I
created a intermediate object "membership" which can store all the
necessary information and even more in future.
--
kind regards,
Franz Koch
More information about the TYPO3-project-typo3v4mvc
mailing list