[TYPO3-mvc] mm relation with attributes

Christian Kartnig office at hahnepeter.de
Fri Jun 10 20:01:15 CEST 2011


Hi Franz!

Thanks a lot for your answer. Thats exactly how I did it.

I have three objects, SpecialField 1 : N SpecialFieldPercentage N : 1 
Company.

But I don't know how to deal with creating the "intermediate" Objects in 
the fluid form. Can you please explain shortly how the fluid form should 
look like? I have no idea how to map the three objects.

Thanks a lot,
Christian




Am 10.06.2011 19:32, schrieb Franz Koch:
> Hey Christian,
>
>> Now I want to have a form for each company where you can assign the
>> percentages of special fields:
>>
>> Special fields for My Company
>>
>> Hardware: ..... %
>> Software: ..... %
>> Whatever: ..... %
>>
>> How do I do that? Should I create a specialfieldPercentage child object
>> for every special field on creation of the company and fill the
>> percentage with 0? Or should I just use normal input fields not bound to
>> objects and then in the controller look for percentage objects that are
>> already there?
>>
>> Can anyone please point me in the right direction? Any hint is greatly
>> appreciated!
>
> If your "mm-table" has some additional properties, you most likely can
> also give the relation a name and thus convert it to a real object
> rather then a "hidden" intermediate table. And by converting it to a
> real object you can easily deal with in forms etc.
> So your domain structure would in the end look somewhat like this:
>
> SpecialField <-> FieldOfActivity <-> Company
>
>
> The "FieldOfActivity" object would have at least these three properties:
> - specialField
> - company
> - percentageOfInterest
> - ...
>
>
> Your "Company" and "SpecialField" objects should use a IRRE relation
> with "foreign_field" configured for the fieldOfActivity table. The
> FieldOfActivity object could either have a select box or a group field
> (whatever you prefer) for company and specialField.
>
> That's at least how I would solve it and what makes most sense to me.
>



More information about the TYPO3-project-typo3v4mvc mailing list