protected function parseLanguage(\stdClass $schema)
    {
        $language = 'english';
        if (!is_object($schema) || !isset($schema->fieldTypes)) {
            return $language;
        }

        foreach ($schema->fieldTypes as $fieldType) {
            if ($fieldType->name !== 'text') {
                continue;
            }
            // we have a text field
            foreach ($fieldType->queryAnalyzer->filters as $filter) {
                if ($filter->class === 'solr.ManagedSynonymGraphFilterFactory') {
                    $language = $filter->managed;
                }
            }
        }

        return $language;
    }
protected function parseLanguage(\stdClass $schema)
    {
        $language = 'english';
        if (!is_object($schema) || !isset($schema->fieldTypes)) {
            return $language;
        }

        foreach ($schema->fieldTypes as $fieldType) {
            if ($fieldType->name !== 'text') {
                continue;
            }
            // we have a text field
            foreach ($fieldType->queryAnalyzer->filters as $filter) {
                if ($filter->class === 'solr.ManagedSynonymGraphFilterFactory') {
                    $language = $filter->managed;
                }
            }
        }

        return $language;
    }
protected function parseLanguage ( \ stdClass $ schema ) { $ language = 'english' ; if ( ! is_object ( $ schema ) || ! isset ( $ schema -> fieldTypes ) ) { return $ language ; } foreach ( $ schema -> fieldTypes as $ fieldType ) { if ( $ fieldType -> name !== 'text' ) { continue ; } // we have a text field foreach ( $ fieldType -> queryAnalyzer -> filters as $ filter ) { if ( $ filter -> class === 'solr.ManagedSynonymGraphFilterFactory' ) { $ language = $ filter -> managed ; } } } return $ language ; }
Extracts the language from a solr schema response.

@param \stdClass $schema
@return string
Extracts the language from a solr schema response .