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:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user