You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
804 B
32 lines
804 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
namespace Chamilo\CourseBundle\Repository;
|
|
|
|
use Chamilo\CoreBundle\Repository\ResourceRepository;
|
|
use Chamilo\CourseBundle\Entity\CExerciseCategory;
|
|
use Doctrine\Persistence\ManagerRegistry;
|
|
|
|
final class CExerciseCategoryRepository extends ResourceRepository
|
|
{
|
|
public function __construct(ManagerRegistry $registry)
|
|
{
|
|
parent::__construct($registry, CExerciseCategory::class);
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getCategories(int $courseId)
|
|
{
|
|
$query = $this->createQueryBuilder('e');
|
|
$query->where('e.course = :cId');
|
|
$query->setParameter('cId', $courseId);
|
|
$query->orderBy('e.position');
|
|
|
|
return $query->getQuery()->getResult();
|
|
}
|
|
}
|
|
|