[TYPO3-mvc] How to create join query with group by in extbase

Steffen Ritter info at rs-websystems.de
Sat Jun 26 13:41:34 CEST 2010


Am 23.06.2010 10:20, schrieb desh.naik at lelesys.com:
> hello
>
> I was trying to developed a extension with extbase a new way of
> developing front end plugin . I liked the way it is done specially bcoz
> it is in MVC structure .
> but i got a problem while doing a join query in the repository .
>
> My query is as follow
>
> "SELECT first_table.*,count(second_table.uid) as issuecount FROM
> first_table JOIN second_table ON first_table.uid = second_table.pid
> GROUP BY second_table.pid "
>
> I tried running this query with
>
> $query->statement("SELECT first_table.*,count(second_table.uid) as
> issuecount FROM first_table JOIN second_table ON first_table.uid =
> second_table.pid GROUP BY second_table.pid")->execute;
>
> the query is running fine but it doesnot return the value of "
> count(second_table.uid) as issuecount " in the object
>
> So does any body know how to write the join query with group by in
> extbase style .
>
> Thanks
well if you have issues as property of your firttable - with lazy loading
you just could add en getter to youir firsttable object getIssueCount()

returning $this->issues->count()




More information about the TYPO3-project-typo3v4mvc mailing list