[FLOW3-general] Help with DQL statement
Mario Beiser
mariobeiser at googlemail.com
Sat Mar 9 10:01:20 CET 2013
Hi list,
I need some help with the following:
We have a relational table that enables ratings on products. We want to
have the (10) best rated products.
Within plain sql, we achieve by:
"SELECT product, user, COUNT(*) as rated FROM
product_catalog_domain_model_rates GROUP BY product ORDER BY rated DESC";
To fire this one with FLOW we have to use a DQL statement (I think???):
$query = $this->entityManager->createQuery('SELECT r.product, r.user,
COUNT(r.ean) as rated FROM \Product\Catalog\Domain\Model\Rates r GROUP BY
r.product ORDER BY rated DESC');
return $query->execute();
FLOW shows the following:
Error: "Semantical Error] line 0, col 17 near 'product, r.user': Invalid
PathExpression. Must be a StateFieldPathExpression;"
Any suggestions how to solve?
thanks,
Mario
More information about the FLOW3-general
mailing list