[TYPO3-mvc] IRRE and intermediate tables

Andreas Kießling andreas.kiessling at web.de
Thu Apr 1 20:46:46 CEST 2010


Hi Jochen,

Am 01.04.10 17:56, schrieb Jochen Rau:
> Hi.
>
> Funny. IRRE (mis)uses the relation table to store (domain) data in it.
> And you (mis)use this behavior to edit a domain object table "through"
> another domain object table. It seems to me that (mis)^2=0 ;-)
>
> IMO a 1:n relation with IRRE doesn't support a selector ATM. But this
> may change in the future (see related post on the IRRE mailinglist
> "[TYPO3-irre] 1:n relations, selector and useCombination"). Thus the
> following configuration would not work (assuming that you have a field
> "title" in your ownership table):
>
> Main table:
> 'owners' => array(
> 'exclude' => 0,
> 'label' =>
> 'LLL:EXT:mymovies/Resources/Private/Language/locallang_db.xml:tx_mymovies_domain_model_movies.owners',
>
> 'config' => array(
> 'type' => 'inline',
> 'foreign_table' => 'tx_mymovies_domain_model_ownership',
> 'foreign_field' => 'movies',
> 'foreign_unique' => 'title',
> 'foreign_selector' => 'title',
> 'size' => 10,
> 'maxitems' => 9999,
> )
> ),
>
> Your solution does only work bacause IRRE "thinks" your table
> "tx_mymovies_domain_model_ownership" is a relation table as shown in the
> irre_tutorial:
>
> "offers" => Array (
> "exclude" => 1,
> "label" =>
> "LLL:EXT:irre_tutorial/locallang_db.xml:tx_irretutorial_hotel.offers",
> "config" => Array (
> "type" => "inline",
> "foreign_table" => "tx_irretutorial_mnasym_hotel_offer_rel",
> "foreign_field" => "hotelid",
> "foreign_sortby" => "hotelsort",
> "foreign_label" => "offerid",
> [...]
> )
> ),
>
> Here, the 'foreign_label' causes IRRE to show up the related record
> (like foreign_selector in your case).

It's rather the page ts for "m:n asymmetric selector", that causes the 
selector to show up:

TCEFORM.tx_irretutorial_mnasym_hotel.offers.config {
   foreign_selector = offerid
   size = 5
}
TCEFORM.tx_irretutorial_mnasym_offer.hotels.config {
   foreign_selector = hotelid
   size = 5
}

Remove that, and the selector is gone, only the "Create new" Button is 
shown.


>
> How to solve this? I tend to allow only "real" relation tables in
> Extbase and mark 1:n relations with a foreign_selector as unsupported
> (by IRRE).
>
> Regards
> Jochen

So how else should the relations / models look like, to give me 
"attributes on relations"? masi did just the same in his 
ballroom_dancing extension, which i took as an example for this setup:
http://forge.typo3.org/repositories/entry/extension-ballroom_dancing/trunk/Configuration/TCA/tca_medium.php


Regards,
Andreas


More information about the TYPO3-project-typo3v4mvc mailing list