public static function get_models_with_insights(\context $context) {

        self::check_can_list_insights($context);

        $models = self::get_all_models(true, true, $context);
        foreach ($models as $key => $model) {
            // Check that it not only have predictions but also generates insights from them.
            if (!$model->uses_insights()) {
                unset($models[$key]);
            }
        }
        return $models;
    }
public static function get_models_with_insights(\context $context) {

        self::check_can_list_insights($context);

        $models = self::get_all_models(true, true, $context);
        foreach ($models as $key => $model) {
            // Check that it not only have predictions but also generates insights from them.
            if (!$model->uses_insights()) {
                unset($models[$key]);
            }
        }
        return $models;
    }
public static function get_models_with_insights ( \ context $ context ) { self :: check_can_list_insights ( $ context ) ; $ models = self :: get_all_models ( true , true , $ context ) ; foreach ( $ models as $ key => $ model ) { // Check that it not only have predictions but also generates insights from them. if ( ! $ model -> uses_insights ( ) ) { unset ( $ models [ $ key ] ) ; } } return $ models ; }
Returns the models with insights at the provided context.

@param \context $context
@return \core_analytics\model[]
Returns the models with insights at the provided context .