[TYPO3-mvc] Customizing joins.

Braulio J. Solano-Rojas braulio at solsoft.biz
Thu May 5 22:38:26 CEST 2011


Hello.

I hope you're doing fine.

I have an object that inherits from 
Tx_Extbase_Domain_Model_FrontendUser.  Then I have created a Country 
model that maps to static_countries through Typoscript:

Tx_TicotalTalent_Domain_Model_Country {
	mapping {
		tableName = static_countries
	}
}

static_countries manual says not to rely on uid since this field can 
change when countries are added or deleted.  Therefore in fe_users table 
the field static_country (a field that exists when sr_feuser_register is 
installed) is a 3 char ISO country code.  To have the country full name 
one has to join against the 3 char ISO code column, not against uid.

It is not possible to change the key field with TCA (at least, I have 
not found a way).

Is it possible to customize the field that is chosen to produce joins in 
extbase?  I have used other frameworks and with those one can change 
join behavior on the fly.  I see that there are join objects in the 
extbase framework, but I can not find a way to use them.

Those objects and interfaces are:
Tx_Extbase_Persistence_QOM_JoinInterface
Tx_Extbase_Persistence_QOM_JoinConditionInterface
Tx_Extbase_Persistence_QOM_Join
Tx_Extbase_Persistence_QOM_EquiJoinCondition

Also, could I create my own 
Tx_Extbase_Persistence_QOM_QueryObjectModelFactory and inject it to my 
query?

All I would like to do is use this code in a query: 
$query->like('staticInfoCountry.cnShortEn', '%'.$keyword.'%').

I know I can write SQL, but I find more maintainable and readable the 
use of extbase functionality.

What do you think? Has someone done this?

Bests,

B.



More information about the TYPO3-project-typo3v4mvc mailing list