public static function fetch_course_category($courseid) {
        if (empty($courseid)) {
            debugging('Missing course id!');
            return false;
        }

        // course category has no parent
        if ($course_category = grade_category::fetch(array('courseid'=>$courseid, 'parent'=>null))) {
            return $course_category;
        }

        // create a new one
        $course_category = new grade_category();
        $course_category->insert_course_category($courseid);

        return $course_category;
    }
public static function fetch_course_category($courseid) {
        if (empty($courseid)) {
            debugging('Missing course id!');
            return false;
        }

        // course category has no parent
        if ($course_category = grade_category::fetch(array('courseid'=>$courseid, 'parent'=>null))) {
            return $course_category;
        }

        // create a new one
        $course_category = new grade_category();
        $course_category->insert_course_category($courseid);

        return $course_category;
    }
public static function fetch_course_category ( $ courseid ) { if ( empty ( $ courseid ) ) { debugging ( 'Missing course id!' ) ; return false ; } // course category has no parent if ( $ course_category = grade_category :: fetch ( array ( 'courseid' => $ courseid , 'parent' => null ) ) ) { return $ course_category ; } // create a new one $ course_category = new grade_category ( ) ; $ course_category -> insert_course_category ( $ courseid ) ; return $ course_category ; }
Return the course level grade_category object

@param int $courseid The Course ID
@return grade_category Returns the course level grade_category instance
Return the course level grade_category object