[TYPO3-mvc] mm-relation in both directions

Michael Ruhdorfer michael.ruhdorfer.1line at gmail.com
Fri Dec 31 09:52:12 CET 2010


hi,

i've got a university model and a course model - these are in a mm relation:

when calling $university->getCourses(), everything is working fine, 
while $course->getUniversities() does show results (also right model is 
returned), but in the wrong direction - this means it is looked up for 
uid_local and returns uid_foreign but i need it the other way round.

TCA Course:

'universities' => array(
	'exclude' => 0,
	'label'   => '...',
	'config'  => array(
		'type' => 'inline',
		'foreign_table' => 'tx_myext_domain_model_university',
		'MM' => 'tx_myext_course_university_mm',
		'maxitems' => 99999
	)
),

TCA University:

'courses' => array(
	'exclude' => 0,
	'label'   => '...',
	'config'  => array(
		'type' => 'inline',
		'foreign_table' => 'tx_myext_domain_model_course',
		'MM' => 'tx_myext_course_university_mm',
		'maxitems' => 99999
	)
),

can anybody tell me what's wrong with my configuration?
thx michael


More information about the TYPO3-project-typo3v4mvc mailing list