Code Duplication    Length = 7-16 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 10160-10175 (lines=16) @@
10157
     *
10158
     * @return mixed
10159
     */
10160
    public static function getCategories($courseId)
10161
    {
10162
        $em = Database::getManager();
10163
        //Default behaviour
10164
        /*$items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy(
10165
            array('cId' => $course_id),
10166
            array('name' => 'ASC')
10167
        );*/
10168
10169
        // Using doctrine extensions
10170
        $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->getBySortableGroupsQuery(
10171
            array('cId' => $courseId)
10172
        )->getResult();
10173
10174
        return $items;
10175
    }
10176
10177
    /**
10178
     * @param int $id
@@ 10194-10200 (lines=7) @@
10191
     * @param int $courseId
10192
     * @return array
10193
     */
10194
    public static function getCategoryByCourse($courseId)
10195
    {
10196
        $em = Database::getManager();
10197
        $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy(array('cId' => $courseId));
10198
10199
        return $items;
10200
    }
10201
10202
    /**
10203
     * @param int $id