[FLOW3-general] Help with DQL statement

Mario Beiser mariobeiser at googlemail.com
Sat Mar 9 12:26:57 CET 2013


Update: solved it by using native query found here:
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/native-sql.html


2013/3/9 Mario Beiser <mariobeiser at googlemail.com>

> 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
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general


More information about the FLOW3-general mailing list