[TYPO3-mvc] Model with a foreign key and the storage pid

Jonas Götze jonnsn at gmail.com
Wed May 19 11:10:23 CEST 2010


Hi list,

I have an extension with 2 tables.
The first table t1 contains a field which matches one uid from the 
second table t2.
Now I want to get a row from t1 and also one field of the matching row 
in t2.
So I defined two Models where the Model1 has a property of Type Model2.
This works fine - but only if the PID of the Row in t2 is the same as in t1.
In my case the records from t2 are created in another page and therefor 
have another PID.
I read some discussions here about the respect-PID-Handling in general 
and found the
$query->getQuerySettings()->setRespectStoragePage(FALSE);
setting. So I tried to override the findByUid-function in my Model2 
including this setting. But this is not called by Extbase when creating 
my Model1-Object.
I also found Issue 5631 [1] and tried to add the setting to these 2 
findObjectByUid-function mentioned there (Mapper.php and Argument.php) 
without success.

Is this somehow possible currently?

Regards
Jonas


[1] http://forge.typo3.org/issues/show/5631


More information about the TYPO3-project-typo3v4mvc mailing list