[TYPO3-mvc] Additional fields in mm-table

Christine Gerpheide cgerpheide at gmail.com
Thu Sep 23 11:59:52 CEST 2010


2010/9/23 Moritz Bützer <moritz at 4eyes.ch>

> Hi List
>
> I've got two tables in relation with an mm table. In the mm table i need
> additional fields. If i adding now a new relation with the attach() method,
> all the existing relations getting overidden. It looks like extbase creates
> for every relation a new entry and dont just adds one.
>
> Does anynone knews a better way to maintain an mm table with additional
> fields or is this not possible?
>
> Thanks and kind regards
> Moritz
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>


Hi Moritz,

I think typically the extbase way of adding fields to a MM table is to
create a new model object to represent the relation, which stores fields for
both the foreign key and local key.  For instance, if you have Students
many-to-many with Classrooms, and you could create an object called
"Participation", which has a student property, a classroom property, and
then whatever additional fields you needed.

hth,
Christine

-- 
Christine Gerpheide   ✈ larissa, greece   @ www.pheide.com


More information about the TYPO3-project-typo3v4mvc mailing list