Prepares language based index mappings according to languages defined in app config multilingual

@param string $className PropertyStorage class name
@return array
761713
private static function prepareMapping($className)
    {
        $mapping = [];
        foreach (self::$languages as $iso_639_2t) {
            if (true === isset(self::$langToAnalyzer[$iso_639_2t])) {
                switch ($className) {
                    case StaticValues::class :
                        self::$staticMapping['properties'][Search::STATIC_VALUES_FILED]['properties']['slug_' . $iso_639_2t] = self::$slugMap;
                        self::$staticValueMap['analyzer'] = self::$langToAnalyzer[$iso_639_2t];
                        self::$staticMapping['properties'][Search::STATIC_VALUES_FILED]['properties']['value_' . $iso_639_2t] = self::$staticValueMap;
                        $mapping = self::$staticMapping;
                        break;
                    case EAV::class :
                        self::$eavValueMap['analyzer'] = self::$langToAnalyzer[$iso_639_2t];
                        self::$eavMapping['properties'][Search::EAV_FIELD]['properties']['str_value_' . $iso_639_2t] = self::$staticValueMap;
                        self::$eavMapping['properties'][Search::EAV_FIELD]['properties']['txt_value_' . $iso_639_2t] = self::$staticValueMap;
                        $mapping = self::$eavMapping;
                        break;
                }
            }
        }
        return $mapping;
    }
279058
private function getTranslatableFields($className)
    {
        // Here we use reflection to get the class
        $reflectionClass = new \ReflectionClass($className);
        $translatableFields = array();
        // and its entities
        $reflectionProperties = $reflectionClass->getProperties();
        foreach ($reflectionProperties as $reflectionProperty) {
            // We use the annotation reader to get the properties annotated with the "Translatable" annotation
            $propertyAnnotation = $this->annotationReader->getPropertyAnnotation($reflectionProperty, 'Gedmo\Mapping\Annotation\Translatable');
            if ($propertyAnnotation) {
                // In this case we have to get the property name and its type in the mapping annotation
                $mappingAnnotation = $this->annotationReader->getPropertyAnnotation($reflectionProperty, 'Doctrine\ORM\Mapping\Column');
                $translatableFields[$reflectionProperty->getName()] = $mappingAnnotation->type;
            }
        }
        return $translatableFields;
    }
1032842
public function getClassPropertyNames($className)
    {
        if (!isset($this->reflectedClassNames[$className])) {
            $this->reflectClass($className);
        }
        return isset($this->classPropertyNames[$className]) ? $this->classPropertyNames[$className] : [];
    }
849649
public function getClassByName($className)
    {
        $classMap = $this->getClassMap($this->splitClassName($className)) . "[\"__class\"]";
        $return = null;

        eval(
            "if (isset(\$this->indexedClasses$classMap)) {"
            . " \$return = \$this->indexedClasses$classMap;"
            . "}"
        );

        return $return;
    }
60546
protected function generateClassName($indexName)
    {
        if (isset($this->_classNames[$indexName])) {
            return $this->_classNames[$indexName];
        }

        if (($pos = strrpos($indexName, '.')) !== false) {
            $indexName = substr($indexName, $pos + 1);
        }

        $db = $this->getDbConnection();
        $patterns = [];
        $patterns[] = "/^{$db->tablePrefix}(.*?)$/";
        $patterns[] = "/^(.*?){$db->tablePrefix}$/";
        if (strpos($this->indexName, '*') !== false) {
            $pattern = $this->indexName;
            if (($pos = strrpos($pattern, '.')) !== false) {
                $pattern = substr($pattern, $pos + 1);
            }
            $patterns[] = '/^' . str_replace('*', '(\w+)', $pattern) . '$/';
        }
        $className = $indexName;
        foreach ($patterns as $pattern) {
            if (preg_match($pattern, $indexName, $matches)) {
                $className = $matches[1];
                break;
            }
        }

        return $this->_classNames[$indexName] = Inflector::id2camel($className, '_');
    }
1177301
public static function getAttributesFor($className)
    {
        if (!self::attributesSetFor($className)) {
            # Force initialize.
            $className::getAttributeSet();
        }
        return self::$classAttributes[$className];
    }
273733
protected function buildClassSchema($className)
    {
        if (!class_exists($className)) {
            throw new Exception('The classname "' . $className . '" was not found and thus can not be reflected.', 1278450972);
        }
        $classSchema = $this->objectManager->get(ClassSchema::class, $className);
        if (is_subclass_of($className, \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class)) {
            $classSchema->setModelType(ClassSchema::MODELTYPE_ENTITY);
            $possibleRepositoryClassName = ClassNamingUtility::translateModelNameToRepositoryName($className);
            if (class_exists($possibleRepositoryClassName)) {
                $classSchema->setAggregateRoot(true);
            }
        } elseif (is_subclass_of($className, \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject::class)) {
            $classSchema->setModelType(ClassSchema::MODELTYPE_VALUEOBJECT);
        }
        foreach ($this->getClassPropertyNames($className) as $propertyName) {
            if (!$this->isPropertyTaggedWith($className, $propertyName, 'transient') && $this->isPropertyTaggedWith($className, $propertyName, 'var')) {
                $cascadeTagValues = $this->getPropertyTagValues($className, $propertyName, 'cascade');
                $classSchema->addProperty($propertyName, implode(' ', $this->getPropertyTagValues($className, $propertyName, 'var')), $this->isPropertyTaggedWith($className, $propertyName, 'lazy'), $cascadeTagValues[0] ?? null);
            }
            if ($this->isPropertyTaggedWith($className, $propertyName, 'uuid')) {
                $classSchema->setUuidPropertyName($propertyName);
            }
            if ($this->isPropertyTaggedWith($className, $propertyName, 'identity')) {
                $classSchema->markAsIdentityProperty($propertyName);
            }
        }
        $this->classSchemata[$className] = $classSchema;
        $this->dataCacheNeedsUpdate = true;
        return $classSchema;
    }
1021673
protected function loadTranslatableMetadata($className, $config)
    {
        if (! isset($config[$className])
            || ! isset($config[$className]['prezent'])
            || ! array_key_exists('translatable', $config[$className]['prezent'])
        ) {
            return;
        }

        $classMetadata = new TranslatableMetadata($className);

        $translatable = $config[$className]['prezent']['translatable'] ?: array();

        $propertyMetadata = new PropertyMetadata(
            $className,
            // defaults to translatable
            isset($translatable['field']) ? $translatable['field'] : 'translations'
        );

        // default targetEntity
        $targetEntity = $className . 'Translation';

        $classMetadata->targetEntity = isset($translatable['targetEntity']) ? $translatable['targetEntity']: $targetEntity;
        $classMetadata->translations = $propertyMetadata;
        $classMetadata->addPropertyMetadata($propertyMetadata);

        if (isset($translatable['currentLocale'])) {
            $propertyMetadata = new PropertyMetadata($className, $translatable['currentLocale']);

            $classMetadata->currentLocale = $propertyMetadata;
            $classMetadata->addPropertyMetadata($propertyMetadata);
        }

        if (isset($translatable['fallbackLocale'])) {
            $propertyMetadata = new PropertyMetadata($className, $translatable['fallbackLocale']);

            $classMetadata->fallbackLocale = $propertyMetadata;
            $classMetadata->addPropertyMetadata($propertyMetadata);
        }

        return $classMetadata;
    }
124463
protected function getFinderMethods($className) {
		$result = [];

		$methods = get_class_methods($className);
		foreach ($methods as $method) {
			$result = $this->addMethod($result, $method);
		}

		return $result;
	}
332751
private function getPossibleValues(string $className): array
    {
        $metadata = $this->entityManager->getClassMetadata($className);
        $standard = array_values($metadata->fieldNames);
        $custom = $this->getCustomSortingNames($className);

        return array_merge($standard, $custom);
    }
1278265
public function getMapperFor($className)
    {
        if (!$this->hasMapperFor($className)) {
            throw new MappingException(sprintf(
                'Class [%s] does not have a mapping configuration. '.
                'Make sure you create a Mapping class that extends either %s, %s or %s. '.
                'If you are using inheritance mapping, remember to create mappings '.
                'for every child of the inheritance tree.',
                $className,
                EntityMapping::class,
                EmbeddableMapping::class,
                MappedSuperClassMapping::class
            ));
        }

        return $this->mappers[$className];
    }
1243977
public function getClassTagsValues($className)
    {
        if (!isset($this->reflectedClassNames[$className])) {
            $this->reflectClass($className);
        }
        if (!isset($this->classTagsValues[$className])) {
            return [];
        }
        return isset($this->classTagsValues[$className]) ? $this->classTagsValues[$className] : [];
    }
112987
public function getSearchableFieldsFor($className) {
		$sng = null;
		if (is_object($className)) {
			$sng = $className;
			$className = get_class($className);
		}
		
		if (!class_exists($className)) {
			return array();
		}

		$searchable = $this->buildSearchableFieldCache();
		$hierarchy = array_reverse(ClassInfo::ancestry($className));
		
		$fieldsToSearch = null;

		foreach ($hierarchy as $class) {
			if (isset($searchable[$class])) {
				$fieldsToSearch = $searchable[$class];
			}
		}

		if (!$sng) {
			$sng = singleton($className);
		}

		if (!$fieldsToSearch) {
			if($sng->hasMethod('getSolrSearchableFields')) {
				$fieldsToSearch = $sng->getSolrSearchableFields();
			} else {
				$fieldsToSearch = $sng->searchableFields();
			}
		}
		
		$sng->extend('updateSolrSearchableFields', $fieldsToSearch);
		return $fieldsToSearch;
	}
1180480
public function getFieldsByClass($className)
    {
        $result = [];

        foreach ($this->fields as $field) {
            if ($field instanceof $className ||
                get_class($field) == $className ||
                (new \ReflectionClass($field))->getShortName() == $className
            ) {
                $result[] = $field;
            }
        }

        return $result;
    }
1266736
public static function classToIndex($className)
    {
        if (false === is_string($className)) {
            return '';
        }
        $modelClass = strtolower($className);
        return StringHelper::basename($modelClass);
    }
556845
protected function get_subclasses($classname) {
        // Get a list of available product classes
        $classnames = ClassInfo::subclassesFor($classname);
        $return = [];

        foreach ($classnames as $classname) {
            $instance = singleton($classname);
            $description = Config::inst()->get($classname, 'description');                    
            $description = ($description) ? $instance->i18n_singular_name() . ': ' . $description : $instance->i18n_singular_name();
            
            $return[$classname] = $description;
        }

        asort($return);
        return $return;
    }
969781
protected function getTypeForClassName($className)
    {
        if (empty($this->rootNamespace)) {
            return $className;
        }
        return $this->stripNamespace($this->rootNamespace, $className);
    }