Code Duplication    Length = 7-16 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 10292-10307 (lines=16) @@
10289
     *
10290
     * @return mixed
10291
     */
10292
    public static function getCategories($courseId)
10293
    {
10294
        $em = Database::getManager();
10295
        //Default behaviour
10296
        /*$items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy(
10297
            array('cId' => $course_id),
10298
            array('name' => 'ASC')
10299
        );*/
10300
10301
        // Using doctrine extensions
10302
        $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->getBySortableGroupsQuery(
10303
            array('cId' => $courseId)
10304
        )->getResult();
10305
10306
        return $items;
10307
    }
10308
10309
    /**
10310
     * @param int $id
@@ 10326-10332 (lines=7) @@
10323
     * @param int $courseId
10324
     * @return array
10325
     */
10326
    public static function getCategoryByCourse($courseId)
10327
    {
10328
        $em = Database::getManager();
10329
        $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy(array('cId' => $courseId));
10330
10331
        return $items;
10332
    }
10333
10334
    /**
10335
     * @param int $id