/** * Resort a categories subcategories shifting the given category down one. * * @param \coursecat $category * @return bool * @throws \moodle_exception */ public static function action_category_change_sortorder_down_one(\coursecat $category) { if (!$category->can_change_sortorder()) { throw new \moodle_exception('permissiondenied', 'error', '', null, 'coursecat::can_change_sortorder'); } return $category->change_sortorder_by_one(false); }