private static function mapFieldType($type, $name = null)
    {
        $types = array(
            'TextField' => 'UserTextField',
            'EmailField' => 'UserEmailField',
            'CheckboxField' => 'UserCheckboxField',
            'OptionsetField' => 'UserOptionSetField'
        );

        $currentDefaults = Attendee::config()->get('default_fields');
        if ($currentDefaults && key_exists($name, $currentDefaults)) {
            return $currentDefaults[$name]['FieldType'];
        } else {
            return $types[$type];
        }

    }