/** * Makes a category hidden given a \coursecat record. * * @param \coursecat $category * @return bool * @throws \moodle_exception */ public static function action_category_hide(\coursecat $category) { if (!$category->can_change_visibility()) { throw new \moodle_exception('permissiondenied', 'error', '', null, 'coursecat::can_change_visbility'); } $category->hide(); return true; }