public static function fetch_notifications($contextid) {
        global $PAGE;

        self::validate_parameters(self::fetch_notifications_parameters(), [
                'contextid' => $contextid,
            ]);

        $context = \context::instance_by_id($contextid);
        self::validate_context($context);

        return \core\notification::fetch_as_array($PAGE->get_renderer('core'));
    }