[TYPO3-mvc] Bidirectional mm

kestutis kestutis1a at gmail.com
Mon May 28 02:18:52 CEST 2012


Hello,

I would like to relate two objects A and B from two different tables 
with mm table.
When A is removed relationship to B in mm table should be removed.
When B is removed relationship to A in mm table should be removed.
Here I would like to manipulate objects without using IRRE, but in 
Extbase model(attach)

In a blog example there is tx_blogexample_post_post_mm table for related 
posts.

<...>
		'related_posts' => array(
			'exclude' => 1,
			'label' => 
'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_post.related',
			'config' => array(
				'type' => 'select',
				'size' => 10,
				'maxitems' => 9999,
				'autoSizeMax' => 30,
				'multiple' => 0,
				'foreign_table' => 'tx_blogexample_domain_model_post',
				'foreign_table_where' => 'AND ###THIS_UID### != 
tx_blogexample_domain_model_post.uid',
				'MM' => 'tx_blogexample_post_post_mm',
				'MM_opposite_field' => 'related_posts',
			)
		),
<...>


When I delete a related post, relationship in a 
tx_blogexample_post_post_mm table remains.
Is it possible to configure TCA in a such way, that removing the object 
will remove a relationship in mm table?


Thank you in advance,
Kast


More information about the TYPO3-project-typo3v4mvc mailing list