@@ 10238-10253 (lines=16) @@ | ||
10235 | * |
|
10236 | * @return mixed |
|
10237 | */ |
|
10238 | public static function getCategories($courseId) |
|
10239 | { |
|
10240 | $em = Database::getManager(); |
|
10241 | //Default behaviour |
|
10242 | /*$items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy( |
|
10243 | array('cId' => $course_id), |
|
10244 | array('name' => 'ASC') |
|
10245 | );*/ |
|
10246 | ||
10247 | // Using doctrine extensions |
|
10248 | $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->getBySortableGroupsQuery( |
|
10249 | array('cId' => $courseId) |
|
10250 | )->getResult(); |
|
10251 | ||
10252 | return $items; |
|
10253 | } |
|
10254 | ||
10255 | /** |
|
10256 | * @param int $id |
|
@@ 10272-10278 (lines=7) @@ | ||
10269 | * @param int $courseId |
|
10270 | * @return array |
|
10271 | */ |
|
10272 | public static function getCategoryByCourse($courseId) |
|
10273 | { |
|
10274 | $em = Database::getManager(); |
|
10275 | $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy(array('cId' => $courseId)); |
|
10276 | ||
10277 | return $items; |
|
10278 | } |
|
10279 | ||
10280 | /** |
|
10281 | * @param int $id |