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