Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.1
-
MOODLE_401_STABLE
-
MOODLE_401_STABLE
-
MDL-74497-master -
Description
While converting current Workplace data sources to use the new core Report Builder we have been following this pattern quite often, sometimes even 7 times in the same data source:
// Add course entity columns/filters/conditions.
|
$this->add_columns_from_entity($courseentityname); |
$this->add_filters_from_entity($courseentityname); |
$this->add_conditions_from_entity($courseentityname); |
It would be really useful to have a couple of new methods to do this at once and keep the current data sources cleaner:
->add_all_from_entity(..) To add all columns/filters/conditions from one entity.
->add_all_from_entities() To add all columns/filters/conditions from all the entities used in the data source.
The code in this example can be simplified using these new methods: