[TYPO3-mvc] record type constraint

Thomas Mammitzsch thomas at visualworx.de
Tue Aug 31 15:57:13 CEST 2010


hi Steffen,

you're right. I defined myself a record type in the mapping. Without it, 
it works now.

regards, Thomas

Am 31.08.2010 15:26, schrieb Steffen Ritter:
> Am 31.08.2010 15:22, schrieb Thomas Mammitzsch:
>> Hi list,
>>
>> extbase is some sort of a hydra. If you solve one problem, you get two
>> new problems :)
>>
>> ok, back to topic. I managed to map my model to the dam table.
>> My repository method is like that:
>>
>> /**
>> * find dam entries which are in comma separated list
>> * @param $list list of comma separated uids
>> * @return Tx_Cdebayarticles_Domain_Model_country
>> */
>> public function findInList($list){
>> $query = $this->createQuery();
>> $query->getQuerySettings()->setRespectStoragePage(FALSE);
>> $result = $query->matching($query->in('uid', $list))
>> ->execute();
>>
>> return $result;
>> }
>>
>> The resulting sql is like that:
>>
>> SELECT tx_dam.* FROM tx_dam WHERE tx_dam.uid IN
>> ('9','10','11','12','13','14','15','16') AND
>> (tx_dam.media_type='Tx_Cdebayarticles_Domain_Model_dam') AND
>> tx_dam.deleted=0 AND tx_dam.t3ver_state<=0 AND tx_dam.hidden=0 AND
>> tx_dam.starttime<=1283258220 AND (tx_dam.endtime=0 OR
>> tx_dam.endtime>1283258220) AND (tx_dam.fe_group='' OR tx_dam.fe_group IS
>> NULL OR tx_dam.fe_group='0' OR (tx_dam.fe_group LIKE '%,0,%' OR
>> tx_dam.fe_group LIKE '0,%' OR tx_dam.fe_group LIKE '%,0' OR
>> tx_dam.fe_group='0') OR (tx_dam.fe_group LIKE '%,-1,%' OR
>> tx_dam.fe_group LIKE '-1,%' OR tx_dam.fe_group LIKE '%,-1' OR
>> tx_dam.fe_group='-1')) AND tx_dam.sys_language_uid IN (0,-1)
>>
>> _Problem here_ is the constraint "AND
>> (tx_dam.media_type='Tx_Cdebayarticles_Domain_Model_dam')".
>> Of course no asset has this media_type (i think its an int value), so i
>> don't get any rows. I don't see why this constraint should make any
>> sense. Is there a way to disable this constraint? I found no direct
>> solution in Typo3DbBackend->parseSource() to disable it.
>>
>> regards, Thomas
>
> if the dam table has an "type-column" this table is handled "as single
> table inheritance" --> therfore you have to map every type of the table
> to one class it should use, extended from one abc.
>
> so in fact: you just did wrong or incomplete table mapping :)



More information about the TYPO3-project-typo3v4mvc mailing list