[TYPO3-dev] [TCA/Extbase] Bidirectional IRRE and 'weak entities'

Daniel Haring daniel at haring.co.at
Mon Dec 21 14:39:20 CET 2015


Hello everybody!

I put quite some effort into this issue but couldn't find a way to achieve my goals. Now I'm in doubt if this is even possible at all.

I'm trying to create an IRRE-relation using an intermediate table which is editable from both endpoints (bidirectional). For usual this is not a big deal, but in my case I'm facing the situation where one side is related to multiple tables and therefore makes use of the property 'foreign_table_field' (weak entity).

Now the problem is, that both fields of the intermediate table which point to the respective records (commonly 'uid_foreign' and 'uid_local') are expected to be of type 'select' or 'group', but afaik neither of them is able to resolve weak entities using an additional table field. Fields of type 'select' simply can't manage multiple tables and type 'group' expects table names to be prepended to the record uids directly (e.g. 'tt_content_21').

So this seems unsolvable to me. Fields of type 'inline' (IRRE) and 'group' are treating multi-table relations differently and therefore are not compatible to each other.

The pain is even getting bigger if trying to implement this in a way Extbase can work with. Afaik Extbase is not able to resolve multi-table relations at all (at least via field type 'select' and 'group').


In my specific case I have a table 'product', which may has some references to an another table called 'product_variety' (but doesn't have to). Both tables store references to another table called 'nutrient' through the intermediate table 'ingredient'. The table 'ingredient' provides additional attributes specifying the contained amount of the assigned nutrient.

The issue emerges as soon as I'm trying to view references from the other side (viewing all products and product varieties which contain a specific nutrient).


Is this concept realizable? Is there any approach I'm not aware of? Or do I have to implement this functionality myself - for example on Repository side (e.g. 'findProductsByIngredient')?


I'd appreciate any kind of thought-provoking impulse!

Thanks in advance and best regards from Austria,
Daniel



More information about the TYPO3-dev mailing list