[TYPO3-mvc] IRRE and intermediate tables
Jochen Rau
jochen.rau at typoplanet.de
Thu Apr 1 17:56:37 CEST 2010
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).
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
More information about the TYPO3-project-typo3v4mvc
mailing list