MDL-64786 analytics: Add missing parameter to model::export() method

All methods that export an object to be rendered via a template, must
have the instance of a renderer available.
This commit is contained in:
David Mudrák
2019-04-15 08:17:45 +02:00
parent bef0fe2000
commit ed47112e1b
3 changed files with 4 additions and 2 deletions
@@ -84,7 +84,7 @@ class models_list implements \renderable, \templatable {
$data->models = array();
foreach ($this->models as $model) {
$modeldata = $model->export();
$modeldata = $model->export($output);
// Check if there is a help icon for the target to show.
$identifier = $modeldata->target->get_identifier();
+2 -1
View File
@@ -1438,9 +1438,10 @@ class model {
/**
* Exports the model data for displaying it in a template.
*
* @param \renderer_base $output The renderer to use for exporting
* @return \stdClass
*/
public function export() {
public function export(\renderer_base $output) {
\core_analytics\manager::check_can_manage_models();
+1
View File
@@ -15,6 +15,7 @@ information provided here is intended especially for developers.
by updating the lib/db/analytics.php file and bumping the core version.
* \core_analytics\model::execute_prediction_callbacks now returns an array with both sample's contexts
and the prediction records.
* \core_analytics\model::export() now expects the renderer instance as an argument.
* Time splitting methods:
* \core_analytics\local\time_splitting\base::append_rangeindex and
\core_analytics\local\time_splitting\base::infer_sample_info are now marked as final and can not