MDL-74497 reportbuilder: Use new methods in existing datasources

- Replace all individual calls to add all columns, filters and
conditions on the cohorts datasource with the new
method add_all_from_entities().

- Replace all individual calls to add all columns, filters and
conditions on the courses datasource with the new
method add_all_from_entities().

- Replace all individual calls to add all columns, filters and
conditions on the users datasource with the new
method add_all_from_entity().
This commit is contained in:
David Matamoros
2022-05-13 08:36:31 +02:00
parent 9a8091d550
commit 5e68da7868
3 changed files with 6 additions and 29 deletions
@@ -56,13 +56,11 @@ class users extends datasource {
$userparamguest => $CFG->siteguest,
]);
// Add all columns from entities to be available in custom reports.
$this->add_entity($userentity);
// Add all columns/filters/conditions from entities to be available in custom reports.
$userentityname = $userentity->get_entity_name();
$this->add_columns_from_entity($userentityname);
$this->add_filters_from_entity($userentityname);
$this->add_conditions_from_entity($userentityname);
$this->add_all_from_entity($userentityname);
}
/**