@@ 10152-10167 (lines=16) @@ | ||
10149 | * |
|
10150 | * @return mixed |
|
10151 | */ |
|
10152 | public static function getCategories($courseId) |
|
10153 | { |
|
10154 | $em = Database::getManager(); |
|
10155 | //Default behaviour |
|
10156 | /*$items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy( |
|
10157 | array('cId' => $course_id), |
|
10158 | array('name' => 'ASC') |
|
10159 | );*/ |
|
10160 | ||
10161 | // Using doctrine extensions |
|
10162 | $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->getBySortableGroupsQuery( |
|
10163 | array('cId' => $courseId) |
|
10164 | )->getResult(); |
|
10165 | ||
10166 | return $items; |
|
10167 | } |
|
10168 | ||
10169 | /** |
|
10170 | * @param int $id |
|
@@ 10186-10192 (lines=7) @@ | ||
10183 | * @param int $courseId |
|
10184 | * @return array |
|
10185 | */ |
|
10186 | public static function getCategoryByCourse($courseId) |
|
10187 | { |
|
10188 | $em = Database::getManager(); |
|
10189 | $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy(array('cId' => $courseId)); |
|
10190 | ||
10191 | return $items; |
|
10192 | } |
|
10193 | ||
10194 | /** |
|
10195 | * @param int $id |