protected function fill_digest_cache() {
        global $DB;

        if (empty($this->users)) {
            return;
        }
        // Get the list of forum subscriptions for per-user per-forum maildigest settings.
        list($in, $params) = $DB->get_in_or_equal(array_keys($this->users));
        $digestspreferences = $DB->get_recordset_select(
                'forum_digests', "userid $in", $params, '', 'id, userid, forum, maildigest');
        foreach ($digestspreferences as $digestpreference) {
            if (!isset($this->digestusers[$digestpreference->forum])) {
                $this->digestusers[$digestpreference->forum] = [];
            }
            $this->digestusers[$digestpreference->forum][$digestpreference->userid] = $digestpreference->maildigest;
        }
        $digestspreferences->close();
    }