I need a DQL query:
$dql = "SELECT p, count(u.id) as ucnt FROM IAA\Entity\Project p " .
"JOIN p.likedByUsers u ORDER BY ucnt";
$query = $this->_em->createQuery($dql);
The question is, how can I sort by invoice, but DO NOT get them as a result? I want to get only projects sorted by invoice, not arrays with [project] and [ucnt].
source
share