i created a query using query builder and now i want to get how many records are in the result but from some reason it throws me NonUniqueResultException
Here is the code
$VideoQueueRepo = $this->_EntityManager->getRepository("TestTestAppBundle:VideoQueue");
$VideoQueue = $VideoQueueRepo->createQueryBuilder('VQ')
->where("VQ.reviewStatus = :ReviewStatus")
->setParameter('ReviewStatus', VideoConstants::STATUS_NEW)
->getQuery();
$VideoQueueCount = $VideoQueue->getSingleScalarResult();
And i cant do this count($VideoQueue->getResult()); because there are around 50 000 records in result and every request for that gets canceled and i get this in symfony log
emergency.EMERGENCY: Allowed memory size of 134217728 bytes exhausted (tried to allocate 87 bytes)
How do i get count of records in result?