MDL-76295 reportbuilder: implement default datasource sorting.

Update all existing report sources to use the new default sorting
API from 064eccd4, updating existing tests to assert behaviour.
This commit is contained in:
Paul Holden
2023-08-23 15:32:50 +01:00
parent b3c2a9fd15
commit 33a63ca639
20 changed files with 201 additions and 107 deletions
@@ -105,6 +105,19 @@ class notes extends datasource {
'note:publishstate',
'course:fullname',
'note:content',
'note:timecreated',
];
}
/**
* Return the column sorting that will be added to the report upon creation
*
* @return int[]
*/
public function get_default_column_sorting(): array {
return [
'recipient:fullname' => SORT_ASC,
'note:timecreated' => SORT_ASC,
];
}