Code Duplication    Length = 7-16 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 10144-10159 (lines=16) @@
10141
     *
10142
     * @return mixed
10143
     */
10144
    public static function getCategories($courseId)
10145
    {
10146
        $em = Database::getManager();
10147
        //Default behaviour
10148
        /*$items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy(
10149
            array('cId' => $course_id),
10150
            array('name' => 'ASC')
10151
        );*/
10152
10153
        // Using doctrine extensions
10154
        $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->getBySortableGroupsQuery(
10155
            array('cId' => $courseId)
10156
        )->getResult();
10157
10158
        return $items;
10159
    }
10160
10161
    /**
10162
     * @param int $id
@@ 10178-10184 (lines=7) @@
10175
     * @param int $courseId
10176
     * @return array
10177
     */
10178
    public static function getCategoryByCourse($courseId)
10179
    {
10180
        $em = Database::getManager();
10181
        $items = $em->getRepository('ChamiloCourseBundle:CLpCategory')->findBy(array('cId' => $courseId));
10182
10183
        return $items;
10184
    }
10185
10186
    /**
10187
     * @param int $id