public static function load_default_models_for_component(string $componentname): array {

        $dir = \core_component::get_component_directory($componentname);

        if (!$dir) {
            // This is either an invalid component, or a core subsystem without its own root directory.
            return [];
        }

        $file = $dir . '/' . self::ANALYTICS_FILENAME;

        if (!is_readable($file)) {
            return [];
        }

        $models = null;
        include($file);

        if (!isset($models) || !is_array($models) || empty($models)) {
            return [];
        }

        foreach ($models as &$model) {
            if (!isset($model['enabled'])) {
                $model['enabled'] = false;
            } else {
                $model['enabled'] = clean_param($model['enabled'], PARAM_BOOL);
            }
        }

        static::validate_models_declaration($models);

        return $models;
    }