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.
This commit is contained in:
Andrew Nicols 2020-04-23 08:30:44 +08:00
parent cd391f9922
commit ff475522fb
3 changed files with 1 additions and 23 deletions

View File

@ -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.
*

View File

@ -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.
*

View File

@ -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);