[TYPO3-mvc] TCA type "inline" - comments and questions
Martin Kutschker
masi-no at spam-typo3.org
Fri Jan 1 20:40:34 CET 2010
Hi!
I'm trying to get a domain working where the DB layout uses the TCA feature "inline". Unfortunately
I'm running into problems.
One cause for them is that there are errors in
Tx_Extbase_Persistence_Mapper_DataMap->setManyToManyRelation(). In two lines a ['config'] is missing
to address the correct part of the array. In another two lines foreign_label (this is *only* for the
BE form) is used where foreign_selector should be used. So here is my try at fixing the relevant code:
$columns = $this->getColumnsDefinition($columnConfiguration['foreign_table']);
$columnMap->setChildClassName($this->determineChildClassName($columns[$columnConfiguration['foreign_selector']]['config']));
$columnMap->setChildTableName($columns[$columnConfiguration['foreign_selector']]['config']['foreign_table']);
$columnMap->setRelationTableName($columnConfiguration['foreign_table']);
$columnMap->setParentKeyFieldName($columnConfiguration['foreign_field']);
$columnMap->setChildKeyFieldName($columnConfiguration['foreign_selector']);
$columnMap->setChildSortByFieldName($columnConfiguration['foreign_sortby']);
Now all fields (perhaps with the exception of childSortBy) are correct.
But unfortunately this leads to a question:
Which classes does the data mapper return?
With an MM-table as relation everything is clear. We have a parent table and class, a relation table
and a child class and table. But without one we have three tables and *three* classes. The relation
table has a class of its own. I don't think that Tx_Extbase_Persistence_Mapper_DataMapper handles
this case.
If I have Tx_Extbase_Persistence_ObjectStorage<Tx_MyExt_Domain_Model_Relation> property in my parent
class, the data mapper tries to load the child objects and not the relation objects. In fact it has
absolutely no idea that they exist. The reason is that simple MM tables and associative entities (a
relation table with attributes) are mapped to RELATION_HAS_AND_BELONGS_TO_MANY. I haven't debugged
this yet, but I fear this is a problem for getPreparedQuery(). I'll have a further look at this
tomorrow.
Masi
More information about the TYPO3-project-typo3v4mvc
mailing list