CQuizQuestionRelCategoryRepository.php 562 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace Entity\Repository;
  3. use Doctrine\ORM\EntityRepository;
  4. use Doctrine\Common\Collections\Criteria;
  5. /**
  6. * CQuizQuestionRelCategoryRepository
  7. *
  8. */
  9. class CQuizQuestionRelCategoryRepository extends EntityRepository
  10. {
  11. public function getCountQuestionByCategory($categoryId)
  12. {
  13. return $this->createQueryBuilder('a')
  14. ->select('COUNT(a)')
  15. ->where('a.categoryId = :categoryId')
  16. ->setParameters(array('categoryId' => $categoryId))
  17. ->getQuery()
  18. ->getSingleScalarResult();
  19. }
  20. }