[TYPO3-mvc] Database query inner join

Steffen Ritter info at rs-websystems.de
Thu Aug 12 11:01:49 CEST 2010


Am 12.08.2010 10:55, schrieb Michael Ruhdorfer:
> does anybody know what i am doing wrong?
not thinking the extbase (object-orientated) way.

you have company and employs,

so to speak, the company the employe works for is an attribut of 
himself, if not you would not like to query "company of employe".

so if you need this, add this attribute to the model directing back to 
the company. Circular relations is no problem for extbase anymore.

then you can query {employe.company} if you implemented __toString() or 
{emploey.company.name}

furthermore you can query or sort by company just giving the "object" paht.

$query->equals('company.city', 'munich');
setOrderings(array('company.zip' => ...));

regards

Steffen


More information about the TYPO3-project-typo3v4mvc mailing list