[TYPO3-mvc] help to n:m relation

Ismaël Bidau bidau at ensci.com
Wed Feb 23 10:24:59 CET 2011


Le 22/02/11 21:00, Franz Koch a écrit :
> Hi Ismaël,
>
>> BUT I want to save university for a student with intermediate table.
>>
>> n:m relation
>> ————————————
>> in tca, type=>'inline', 'foreign_table'=>'tx_student_university',
>> 'foreign_field' => 'uid_local'
>>
>> HOW TO ?
>
> what should be the result of this? Using IRRE like that doens't mean to
> use a intermediate (MM) table.

i want to use an intermediate table to store start and end dates (this 
student is in this university from 10-01-2010 to 08-31-2011 and in 
another one from 09-01-2011 to 08-31-2012)

  By such a configuration you would allow
> more than one university for a student and thus your university property
> should be a objectStorage - is that intended?

yes

  If the relation should
> still have just one university try setting "maxitems => 1" in your TCA.
>
> Maybe you could explain how it's supposed to work and then I can tell
> you which adjustments you have to take.

In Frontend, i want to have a form like this :

you name :
...
your studies
	university1 :		from : 		to :
	university2 :		from : 		to :

I know how to store the name (in table tx_student_list), I know how to 
create a selectbox with a list of universities (from table 
tx_university_list)) but I don't know how to save in the third table 
(tx_student_university with fields uid_local for uid_student, 
uid_foreign for uid_university, start, end)

Thanks again for your help,

Ismaël BIDAU



More information about the TYPO3-project-typo3v4mvc mailing list