[TYPO3-mvc] IRRE and intermediate tables

Jochen Rau jochen.rau at typoplanet.de
Tue Mar 30 15:29:55 CEST 2010


Hi.

There were several discussions in this group about how to configure IRRE 
with intermediate tables.

[TYPO3-mvc] IRRE intermediate tables
[TYPO3-mvc] IRRE foreign_selector ("associative entity")
[TYPO3-mvc] Attributes on irre-relations possible?

With the latest revision of Extbase the problems related to these topics 
are (hopefully) resolved.

IRRE allows two ways to use an "intermediate" table. Let's see how the 
"tags" column of the table tx_blogexample_domain_model_post can be 
configured using IRRE. Keep in mind that we have a m:n-relation (a post 
may have several tags and a tag may be assigned to several posts) and 
that these configurations are minimalistic.

1)

'tags' => array(
	'label' => 'Tags',
	'config' => array(
		'type' => 'inline',
		'foreign_table' => 'tx_blogexample_post_tag_mm',
		'foreign_field' => 'uid_local',
		'foreign_selector' => 'uid_foreign'
	)
),


2)

'tags' => array(
	'label' => 'Tags',
	'config' => array(
		'type' => 'inline',
		'foreign_table' => 'tx_blogexample_domain_model_tag',
		'foreign_field' => 'tx_blogexample_post_tag_mm',
	)
),

1) is described in the irre_tutorial, 2) in core documentation. Both are 
working in FE and BE now with Extbase. Some notes:

- The intermediate table in 1) isn't really an intermediate table. It's 
a foreign key relation where the foreign key (uid_local) is stored on 
the foreign table tx_blogexample_post_tag_mm. Only IRRE considers this 
as an "intermediate" table that can hold additional (domain related) fields.

- Using 1) you have to specify a foreign_selector (uid_foreign) to be 
able to edit the associated table tx_blogexample_domain_model_tag 
"through" the "intermediate" table tx_blogexample_post_tag_mm. Extbase 
doesn't support additional domain related data on an intermediate table. 
Implement a real domain model in this case (see thread [TYPO3-mvc] IRRE 
foreign_selector ("associative entity")).

- Having defined a foreign_label doesn't have any effect in Extbase now.

- It's recommend to use always the second configuration. Unfortunately, 
I didn't find a way in IRRE to have a foreign_selector in combination 
with real intermediate tables.

Please test the latest rev. of Extbase and report your results.

Regards
Jochen




More information about the TYPO3-project-typo3v4mvc mailing list