Code Duplication    Length = 7-16 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 10249-10264 (lines=16) @@
10246
     *
10247
     * @return mixed
10248
     */
10249
    public static function getCategories($courseId)
10250
    {
10251
        $em = Database::getManager();
10252
        //Default behaviour
10253
        /*$items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy(
10254
            array('cId' => $course_id),
10255
            array('name' => 'ASC')
10256
        );*/
10257
10258
        // Using doctrine extensions
10259
        $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->getBySortableGroupsQuery(
10260
            array('cId' => $courseId)
10261
        )->getResult();
10262
10263
        return $items;
10264
    }
10265
10266
    /**
10267
     * @param int $id
@@ 10283-10289 (lines=7) @@
10280
     * @param int $courseId
10281
     * @return array
10282
     */
10283
    public static function getCategoryByCourse($courseId)
10284
    {
10285
        $em = Database::getManager();
10286
        $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy(array('cId' => $courseId));
10287
10288
        return $items;
10289
    }
10290
10291
    /**
10292
     * @param int $id