public static function fetch_course_item($courseid) {
        if ($course_item = grade_item::fetch(array('courseid'=>$courseid, 'itemtype'=>'course'))) {
            return $course_item;
        }

        // first get category - it creates the associated grade item
        $course_category = grade_category::fetch_course_category($courseid);
        return $course_category->get_grade_item();
    }
public static function fetch_course_item($courseid) {
        if ($course_item = grade_item::fetch(array('courseid'=>$courseid, 'itemtype'=>'course'))) {
            return $course_item;
        }

        // first get category - it creates the associated grade item
        $course_category = grade_category::fetch_course_category($courseid);
        return $course_category->get_grade_item();
    }
public static function fetch_course_item ( $ courseid ) { if ( $ course_item = grade_item :: fetch ( array ( 'courseid' => $ courseid , 'itemtype' => 'course' ) ) ) { return $ course_item ; } // first get category - it creates the associated grade item $ course_category = grade_category :: fetch_course_category ( $ courseid ) ; return $ course_category -> get_grade_item ( ) ; }
Returns the grade item associated with the course

@param int $courseid
@return grade_item Course level grade item object
Returns the grade item associated with the course