Gets a collection of field aliases for an object by class name.

@param string $className The name of the class to lookup field aliases for.
@return array An array of field aliases with aliases as keys and actual field names as values.
334618
public function getFieldAliases($className) {
        $fieldAliases= array ();
        if ($className= $this->loadClass($className)) {
            if ($ancestry= $this->getAncestry($className)) {
                for ($i= count($ancestry) - 1; $i >= 0; $i--) {
                    if (isset ($this->map[$ancestry[$i]]['fieldAliases'])) {
                        $fieldAliases= array_merge($fieldAliases, $this->map[$ancestry[$i]]['fieldAliases']);
                    }
                }
            }
            if ($this->getInherit($className) === 'single') {
                $descendants= $this->getDescendants($className);
                if ($descendants) {
                    foreach ($descendants as $descendant) {
                        $descendantClass= $this->loadClass($descendant);
                        if ($descendantClass && isset($this->map[$descendantClass]['fieldAliases'])) {
                            $fieldAliases= array_merge($fieldAliases, array_diff_key($this->map[$descendantClass]['fieldAliases'], $fieldAliases));
                        }
                    }
                }
            }
        }
        return $fieldAliases;
    }
278585
public function getRealFieldName($className, $field)
    {
        $apiMapping = $this->getApiMapping($className);
        return $this->getMappedKey($apiMapping, $field);
    }
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;
	}
478735
public function getByClass($className)
    {
        $types = array_unique(Arr::wrap(Arr::get($this->classMapping, $className, [])));
        $resolved = array_map([$this, 'get'], $types);

        return $this->firstOrAll(Arr::collapse($resolved));
    }
231104
public function getMappingByClassName(string $className) : Mapping
    {
        $className = ltrim($className, '\\');

        return (!empty($this->mappings[$className])) ? $this->mappings[$className] : Mapping::null();
    }
988410
public function getMetadataFor($className)
    {
        if ( ! isset($this->loadedMetadata[$className])) {
//            print_r('loading class ' . $className . "\n");
            $realClassName = $className;

            // Check for namespace alias
            if (strpos($className, ':') !== false) {
                list($namespaceAlias, $simpleClassName) = explode(':', $className);
                $realClassName = $this->configuration->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;

                if (isset($this->loadedMetadata[$realClassName])) {
                    // We do not have the alias name in the map, include it
                    $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName];

                    return $this->loadedMetadata[$realClassName];
                }
            }

            if ($this->cacheDriver) {
                if (($cached = $this->cacheDriver->fetch("$realClassName\$XMLCLASSMETADATA")) !== false) {
                    $this->loadedMetadata[$realClassName] = $cached;
                    if (!$cached->isMappedSuperclass) {
                        $this->xmlToClassMap[$cached->getXmlName()] = $realClassName;
                    }
                } else {
                    foreach ($this->loadMetadata($realClassName) as $loadedClassName) {
                        $this->cacheDriver->save(
                            "$loadedClassName\$XMLCLASSMETADATA", $this->loadedMetadata[$loadedClassName], null
                        );
                    }
                }
            } else {
                $this->loadMetadata($realClassName);
            }

            if ($className != $realClassName) {
                // We do not have the alias name in the map, include it
                $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName];
            }
        }

        return $this->loadedMetadata[$className];
    }
95893
public static function getClassAnnotations($className)
    {
        if (!isset(self::$annotationCache[$className])) {
            $class = new \ReflectionClass($className);
            self::$annotationCache[$className] = self::parseAnnotations($class->getDocComment());
        }

        return self::$annotationCache[$className];
    }
681455
public function findInheritanceByClassname(string $className): array
    {
        if (isset(self::$inheritanceByClassnameMap[$className])) {
            return self::$inheritanceByClassnameMap[$className];
        }

        if (!isset(self::$classAstMap[$className])) {
            return self::$inheritanceByClassnameMap[$className] = [];
        }

        return self::$inheritanceByClassnameMap[$className] = AstHelper::findInheritances(
            self::$classAstMap[$className]
        );
    }
1038626
public static function getParentClasses($className) {
        $result = array();
        $class = new \ReflectionClass($className);
        if( false === $class ) {
            return $result;
        }
        do {
            $name = $class->getName();
            $result[] = $name;
            $class = $class->getParentClass();
        } while( false !== $class );
        return $result;
    }
1361996
public function getFieldAlias($className, $field)
    {
        $apiMapping = $this->getApiMapping($className);
        $apiMapping = array_flip($apiMapping);
        return $this->getMappedKey($apiMapping, $field);
    }
96139
public function getClassInherits(string $className): array
    {
        $buffer = [];

        foreach ($this->astParser->findInheritanceByClassname($className) as $dep) {
            $buffer[] = $dep;

            foreach ($this->resolveDepsRecursive($dep) as $recDep) {
                $buffer[] = $recDep;
            }
        }

        return $buffer;
    }
1153640
public function getAllSearchableFieldsFor($classNames) {
		$allfields = array();
		foreach ($classNames as $className) {
			$fields = $this->getSearchableFieldsFor($className);
			$allfields = array_merge($allfields, $fields);
		}
		
		return $allfields;
	}
1076873
public function getByClassname(string $classname)
    {
        foreach ($this->container as $value) {
            if (is_object($value) && $value instanceof $classname) {
                return $value;
            }
        }

        return null;
    }
111598
private function getOperatorFieldName(string $className): string
    {
        $name = preg_replace('~OperatorType$~', '', Utils::getTypeName($className));

        return lcfirst($name);
    }
119891
protected function getIdentifierRepository($className)
    {
        $class = $this->getClassMetadata($className);

        return $this->pool->getManager($class->getManagerIdentifier())->getRepository($class->getFieldMapping($class->getManagerIdentifier())->getName());
    }
327666
public static function getEventNames($className)
    {
        $result = [];
        $reflection = new \ReflectionClass($className);
        foreach ($reflection->getConstants() as $name => $value) {
            if (!preg_match('/^EVENT/', $name)) {
                continue;
            }
            $result[$name] = $value;
        }
        return $result;
    }
1135033
public function getMetadataFor($className) : ClassMetadata
    {
        if (isset($this->loadedMetadata[$className])) {
            return $this->loadedMetadata[$className];
        }

        $realClassName = $this->normalizeClassName($className);

        if (isset($this->loadedMetadata[$realClassName])) {
            // We do not have the alias name in the map, include it
            return $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName];
        }

        $metadataBuildingContext = $this->newClassMetadataBuildingContext();
        $loadingException        = null;

        try {
            if ($this->cacheDriver) {
                $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt);

                if ($cached instanceof ClassMetadata) {
                    $this->loadedMetadata[$realClassName] = $cached;

                    $cached->wakeupReflection($metadataBuildingContext->getReflectionService());
                } else {
                    foreach ($this->loadMetadata($realClassName, $metadataBuildingContext) as $loadedClass) {
                        $loadedClassName = $loadedClass->getClassName();

                        $this->cacheDriver->save($loadedClassName . $this->cacheSalt, $loadedClass, null);
                    }
                }
            } else {
                $this->loadMetadata($realClassName, $metadataBuildingContext);
            }
        } catch (CommonMappingException $loadingException) {
            $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName, $metadataBuildingContext);

            if (! $fallbackMetadataResponse) {
                throw $loadingException;
            }

            $this->loadedMetadata[$realClassName] = $fallbackMetadataResponse;
        }

        if ($className !== $realClassName) {
            // We do not have the alias name in the map, include it
            $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName];
        }

        $metadataBuildingContext->validate();

        return $this->loadedMetadata[$className];
    }