[TYPO3-mvc] AVG, SUM in Repository
Frank Gerards
F.Gerards at esolut.de
Mon Jan 30 17:39:26 CET 2012
Hi,
maybe use $query->statement ?
-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Stefan Frömken
Gesendet: Montag, 30. Januar 2012 17:30
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: [TYPO3-mvc] AVG, SUM in Repository
Hello MVC-List,
has anybody an idea how to create a SUM or AVG Query in Repository?
OK...I can query on my own with $query->statement, but the result is always empty. I think that is because of method: >>parseQuery<< where fields will be set to >>$table . '*'<<. So something like >>SUM(field)<< will never work.
Further I tries to modify Tx_Extbase_Persistence_Query:
config.tx_extbase {
objects {
Tx_Extbase_Persistence_Query {
className = Tx_KeZr_Persistence_Query
}
}
}
But in Frontend following appears:
Fatal error: Call to undefined method
Tx_Extbase_Persistence_Query::sum() in
/var/www/typo3_45/typo3conf/ext/myExt/Classes/Domain/Repository/InvoiceRepository.php
on line 33
Does my TS don't works with this class?
I can do a
$GLOBALS['TYPO3_DB']->sql_query('SELECT SUM(col) FROM table'); because I need the where clause of the repository. The user can change the amount of records or filter them...so...how to get the current where clause out of the repository?
Maybe you have some better ideas?
Stefan
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
More information about the TYPO3-project-typo3v4mvc
mailing list