Code Duplication    Length = 7-16 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 10184-10199 (lines=16) @@
10181
     *
10182
     * @return mixed
10183
     */
10184
    public static function getCategories($courseId)
10185
    {
10186
        $em = Database::getManager();
10187
        //Default behaviour
10188
        /*$items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy(
10189
            array('cId' => $course_id),
10190
            array('name' => 'ASC')
10191
        );*/
10192
10193
        // Using doctrine extensions
10194
        $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->getBySortableGroupsQuery(
10195
            array('cId' => $courseId)
10196
        )->getResult();
10197
10198
        return $items;
10199
    }
10200
10201
    /**
10202
     * @param int $id
@@ 10218-10224 (lines=7) @@
10215
     * @param int $courseId
10216
     * @return array
10217
     */
10218
    public static function getCategoryByCourse($courseId)
10219
    {
10220
        $em = Database::getManager();
10221
        $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy(array('cId' => $courseId));
10222
10223
        return $items;
10224
    }
10225
10226
    /**
10227
     * @param int $id