I want to count number of rows whose return from DQL query,how i do this? here is my DQL query:
$items=$em->createQuery("select i.unitPrice,i.quantity,i.linetotal,i.description from InvoicesInvoicesBundle:Invoiceshasitems i where i.invoiceid='".$id."'");
$itemdata=$items->getResult();
Use Count()
$items=$em->createQuery("select COUNT(i.unitPrice)
from InvoicesInvoicesBundle:Invoiceshasitems i
where i.invoiceid='".$id."'");
$itemdata=$items->getResult();
http://docs.doctrine-project.org/en/2.1/reference/dql-doctrine-query-language.html
you should bookmark the above link if you are working regularly on DQL.