public static function get_favourites_info_for_user(int $userid, \context $context,
                                                        string $component, string $itemtype, int $itemid) {
        global $DB;

        $params = [
            'userid' => $userid,
            'component' => $component,
            'itemtype' => $itemtype,
            'itemid' => $itemid,
            'contextid' => $context->id
        ];

        if (!$favourited = $DB->get_record('favourite', $params)) {
            return;
        }

        return [
            'starred' => transform::yesno(true),
            'ordering' => $favourited->ordering,
            'timecreated' => transform::datetime($favourited->timecreated),
            'timemodified' => transform::datetime($favourited->timemodified)
        ];
    }