[TYPO3-mvc] Relations to non existing Domain-Models (eg. fe_groups and sys_language)
Christopher Hlubek
hlubek at networkteam.com
Mon Jul 20 15:59:03 CEST 2009
Hi,
I think this patch is more or less right, but in the wrong place. A TCA
config without foreign class name shouldn't be considered a relation.
See the patch in my last message, where I fixed this issue to make our
app work (in the DataMap). Otherwise Extbase would be a little to greedy
for fields that should be a relation in the TCA for the backend but not
for Extbase (for legacy and flexibility).
Greetings,
Christopher
Jochen Rau schrieb:
> Hi.
>
> Benno Weinzierl wrote:
>> Hey guys,
>>
>> i think that Issue #3440 is not a feature as declared but it is a bug
>> that
>> should be fixed before extbase is out of alpha-state.
>>
>> The reason:
>> I have a Model with a relation to fe_groups. There is not yet a Model for
>> fe_groups but thats not the Problem.
>> The big problem is that this beakes my plugin with a broken sql-statement
>> because of a missing classname in the TCA.
>>
>> It can be easily fixed by the following code:
>>
>> Index: Classes/Persistence/Mapper/DataMapper.php
>> ===================================================================
>> --- Classes/Persistence/Mapper/DataMapper.php (revision 970)
>> +++ Classes/Persistence/Mapper/DataMapper.php (working copy)
>> @@ -220,7 +220,7 @@
>> if ($columnMap->getTypeOfRelation() ===
>> Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_ONE) {
>> $query =
>> $this->queryFactory->create($columnMap->getChildClassName());
>> $result =
>> current($query->matching($query->withUid($row[$columnMap->getColumnName()]))->execute());
>>
>> - } elseif ($columnMap->getTypeOfRelation() ===
>> Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_MANY) {
>> + } elseif ($columnMap->getTypeOfRelation() ===
>> Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_MANY&&
>> $columnMap->getChildClassName()) {
>> $objectStorage = new Tx_Extbase_Persistence_ObjectStorage();
>> $query =
>> $this->queryFactory->create($columnMap->getChildClassName());
>> $objects =
>> $query->matching($query->equals($columnMap->getParentKeyFieldName(),
>> $parentObject->getUid()))->execute();
>>
>>
>> Is it possible to include this? Maybe some more code is needed for the
>> other
>> relations but this fixes my broken relation to fe_groups.
>
> Thanks for your patch. We intend to implement a more general solution
> for this issue.
>
> Please see my post "FYI: Progress in implementing support for generic
> domain models" for more information.
>
> Regards
> Jochen
>
>
More information about the TYPO3-project-typo3v4mvc
mailing list