public function delete_data_for_users_in_context(\core_privacy\local\request\userlist_collection $collection) {
        $progress = static::get_log_tracer();

        $a = (object) [
            'contextid' => $collection->get_context()->id,
            'total' => count($collection),
            'progress' => 0,
            'component' => '',
            'datetime' => userdate(time()),
        ];

        // Delete the data.
        $progress->output(get_string('trace:deletingapprovedusers', 'core_privacy', $a), 1);
        foreach ($collection as $userlist) {
            if (!$userlist instanceof \core_privacy\local\request\approved_userlist) {
                throw new \moodle_exception('The supplied userlist must be an approved_userlist');
            }

            $component = $userlist->get_component();
            $a->component = $component;
            $a->progress++;
            $a->datetime = userdate(time());

            if (empty($userlist)) {
                // This really shouldn't happen!
                continue;
            }

            $progress->output(get_string('trace:processingcomponent', 'core_privacy', $a), 2);

            $this->handled_component_class_callback($component, core_userlist_provider::class,
                    'delete_data_for_users', [$userlist]);
        }

        $progress->output(get_string('trace:done', 'core_privacy'), 1);
    }