1234567891011121314151617181920212223 |
- <?php
- namespace Entity\Repository;
- use Doctrine\ORM\EntityRepository;
- use Doctrine\Common\Collections\Criteria;
- /**
- * CQuizQuestionRelCategoryRepository
- *
- */
- class CQuizQuestionRelCategoryRepository extends EntityRepository
- {
- public function getCountQuestionByCategory($categoryId)
- {
- return $this->createQueryBuilder('a')
- ->select('COUNT(a)')
- ->where('a.categoryId = :categoryId')
- ->setParameters(array('categoryId' => $categoryId))
- ->getQuery()
- ->getSingleScalarResult();
- }
- }
|