[TYPO3-mvc] Extbase Query - Static info tables and static territories

Peter Falk pf1 at isight.dk
Thu Dec 20 21:18:44 CET 2012


Hi,

I want to extract a number of objects depending on which continent they 
belong. I have only the country code, taken from static_countries, but 
needs to extract on basis of 'tr_parent_iso_nr' in static_territories.

I can write a query->statement that works as intended, but I hope there 
is a nicer way to do it?

I have tried using contains, but got the following error: "call to 
member function getParentKeyFieldName () on a non-object"

All the relevant fields from respectively static_countries and 
static_territories is mapped in TypoScript.

In short, this is what I want to do:

SELECT myModel.*
FROM myModel, static_countries, static_territories
WHERE
myModel.country = static_countries.uid AND
static_countries.cn_parent_tr_iso_nr = static_territories.tr_iso_nr AND
static_territories.tr_parent_iso_nr = $continent

$continent can be either 2,9,19,142,150

... but of cause I want this done using the extbase api

Typo3: 4.7.7

Thanks in advance
Peter


More information about the TYPO3-project-typo3v4mvc mailing list