static function getClassAttributeType( eZContentClassAttribute $classAttribute, $subAttribute = null, $context = 'search' )
    {
        $eZFindIni = eZINI::instance( 'ezfind.ini' );
        // Subattribute-related behaviour here.
        $datatypeString = $classAttribute->attribute( 'data_type_string' );
        $customMapList = $eZFindIni->variable( 'SolrFieldMapSettings', 'CustomMap' );

        if ( array_key_exists( $datatypeString, $customMapList ) )
        {
            if ( self::isStaticDelegationAllowed( $customMapList[$datatypeString], 'getClassAttributeType' ) and
                 ( $returnValue = call_user_func_array( array( $customMapList[$datatypeString], 'getClassAttributeType' ),
                                                        array( $classAttribute, $subAttribute, $context ) ) )
               )
            {
                return $returnValue;
            }
        }

        // Fallback #1: single-fielded datatype behaviour here.
        $datatypeMapList = $eZFindIni->variable( 'SolrFieldMapSettings', eZSolr::$fieldTypeContexts[$context] );
        if ( !empty( $datatypeMapList[$classAttribute->attribute( 'data_type_string' )] ) )
        {
            return $datatypeMapList[$classAttribute->attribute( 'data_type_string' )];
        }
        // Fallback #2: search field datatypemap (pre ezfind 2.2 behaviour)
        $datatypeMapList = $eZFindIni->variable( 'SolrFieldMapSettings', 'DatatypeMap' );
        if ( !empty( $datatypeMapList[$classAttribute->attribute( 'data_type_string' )] ) )
        {
            return $datatypeMapList[$classAttribute->attribute( 'data_type_string' )];
        }
        // Fallback #3: return default field.
        return $eZFindIni->variable( 'SolrFieldMapSettings', 'Default' );
    }