From ff475522fb480254a37d77608ccba96848d7c3bf Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 23 Apr 2020 08:30:44 +0800 Subject: [PATCH] MDL-68454 table: Drop get_unique_id_from_argument fn requirement This was originally intended to be a way for the calling code to specify data as part of the table construction which could then be used as appropriate. When the filterset was created the requirement for this function no longer existed. Removing this to simplify the API. --- lib/table/classes/dynamic.php | 13 ------------- user/classes/table/participants.php | 9 --------- user/index.php | 2 +- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/lib/table/classes/dynamic.php b/lib/table/classes/dynamic.php index 69701a04567..1ec81b0ba51 100644 --- a/lib/table/classes/dynamic.php +++ b/lib/table/classes/dynamic.php @@ -40,19 +40,6 @@ use core_table\local\filter\filterset; */ interface dynamic { - /** - * Take a string and convert it to the format expected by the table. - * For example, you may have a format such as: - * - * mod_assign-submissions-[courseid] - * - * Passing this function an argument of [courseid] would return the fully-formed string. - * - * @param string $argument - * @return string - */ - public static function get_unique_id_from_argument(string $argument): string; - /** * Get the base url. * diff --git a/user/classes/table/participants.php b/user/classes/table/participants.php index b1f43958507..cc9dc7f29d3 100644 --- a/user/classes/table/participants.php +++ b/user/classes/table/participants.php @@ -537,15 +537,6 @@ class participants extends \table_sql implements dynamic_table { $this->define_baseurl($this->get_base_url()); } - /** - * Get an unique id for the participants table. - * @param string $argument An argument for the unique id, can be course id. - * @return string - */ - public static function get_unique_id_from_argument(string $argument): string { - return "user-index-participants-{$argument}"; - } - /** * Get the base url for the participants table. * diff --git a/user/index.php b/user/index.php index 1082bbc1783..92f81e2bfdb 100644 --- a/user/index.php +++ b/user/index.php @@ -275,7 +275,7 @@ if (count($keywordfilter)) { $filterset->add_filter($keywordfilter); } -$participanttable = new \core_user\table\participants(\core_user\table\participants::get_unique_id_from_argument($course->id)); +$participanttable = new \core_user\table\participants("user-index-participants-{$course->id}"); $participanttable->set_selectall($selectall); $participanttable->set_filterset($filterset); $participanttable->define_baseurl($baseurl);