public static function action_category_resort_courses(\core_course_category $category, $sort, $cleanup = true) {
        if (!$category->can_resort_courses()) {
            throw new \moodle_exception('permissiondenied', 'error', '', null, 'core_course_category::can_resort');
        }
        return $category->resort_courses($sort, $cleanup);
    }
public static function action_category_resort_courses(\core_course_category $category, $sort, $cleanup = true) {
        if (!$category->can_resort_courses()) {
            throw new \moodle_exception('permissiondenied', 'error', '', null, 'core_course_category::can_resort');
        }
        return $category->resort_courses($sort, $cleanup);
    }
public static function action_category_resort_courses ( \ core_course_category $ category , $ sort , $ cleanup = true ) { if ( ! $ category -> can_resort_courses ( ) ) { throw new \ moodle_exception ( 'permissiondenied' , 'error' , '' , null , 'core_course_category::can_resort' ) ; } return $ category -> resort_courses ( $ sort , $ cleanup ) ; }
Resorts the courses within the given category.

@param \core_course_category $category
@param string $sort One of fullname, shortname or idnumber
@param bool $cleanup If true cleanup will be done, if false you will need to do it manually later.
@return bool
@throws \moodle_exception
Resorts the courses within the given category .