[TYPO3-mvc] How to use the table "pages"?

Jochen Rau jochen.rau at typoplanet.de
Wed Jun 23 18:03:34 CEST 2010


Hi Tobias.

On 2010-06-23, Tobias Pinnekamp <tobias.pinnekamp at itao.de> wrote:
> Franz Koch wrote:
>> give $query->getQuerySettings()->setRespectStoragePage(FALSE); a try.
>
> thx for your hint. This removes the pid-condition if I build a custom 
> query. The only problem left is that the generated query contains a 
> condition like (pages.doktype='Tx_MyExtension_Domain_Model_Page') which 
> I think it comes from the configured type-field in TCA.
> If I add an extra condition for the field "doktype" witch 
> $query->matching($query->equals('doktype', 1)) then it is an additional 
> condition to the one generated automatically.

The mapping is done automatically by Extbase. You have to configure the recordType according to the 	

config.tx_extbase {
	persistence{
		classes {
			Tx_MyExtension_Domain_Model_Page {
				mapping {
					tableName = pages
					recordType = 1 # for doktype "Standard"
				}
			}
		}
	}
}

If you want to map more than one doktype to your model you have to build a class hierarchy with a super- and some subclasses.

> Is there some like setRespectTypeField(false) ???

No. But this might be a handy feature.

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list