[TYPO3-mvc] Query object and Joins

Dmitri Pisarev dimaip at gmail.com
Wed Mar 17 18:30:49 CET 2010


Hi!
I'm still on my way discovering extbase, this time I got to Query object...

I have an object Tariff which has a property service of type Service, 
which has a property type of type Servicetype. So I need to select all 
tariffs of certain type.
Normally I would create a join for that.

What I already understand:
1) Query object doesn't support joins.
2) Tx_Extbase_Persistence_QOM_QueryObjectModelFactory has something that 
can help with joins.
3) getPreparedQuery function from DataMapper has an example of a joined 
query.
What I don't understand:
1) How to get Tx_Extbase_Persistence_QOM_QueryObjectModelFactory object 
into my TariffRepository. In DataMapper it's being injected in some 
crazy way which I can't grasp at all...
2) Does it really need to be so complected? Any plans for introducing 
joins into Query object?
3) How should I do it anyway? Just give up and return to SQL?:
$query->statement('SELECT * FROM tx_alex_domain_model_tariff LEFT JOIN 
tx_alex_domain_model_service ON tx_alex_domain_model_tariff.service = 
tx_alex_domain_model_service.uid');

I shall appreciate any help!
Dmitri.


More information about the TYPO3-project-typo3v4mvc mailing list