Build full class chain.

@param string $className
@param string $classAlias

@return array
960772
public function getFullChain($className, $classAlias)
    {
        $fullChain = [];
        $lowerCaseClassAlias = strtolower($classAlias);
        $lowerCaseClassName = strtolower($className);

        $variablesLocator = $this->getModuleVariablesLocator();
        $modules = $this->getModulesArray($variablesLocator);
        $modules = array_change_key_case($modules);
        $allExtendedClasses = array_keys($modules);
        $currentExtendedClasses = array_intersect($allExtendedClasses, [$lowerCaseClassName, $lowerCaseClassAlias]);
        if (!empty($currentExtendedClasses)) {
            /*
             * there may be 2 class chains, matching the same class:
             * - one for the class alias like 'oxUser' - metadata v1.1
             * - another for the real class name like 'OxidEsales\Eshop\Application\Model\User' - metadata v1.2
             * These chains must be merged in the same order as they appear in the modules array
             */
            $classChains = [];
            /* Get the position of the class name */
            if (false !== $position = array_search($lowerCaseClassName, $allExtendedClasses)) {
                $classChains[$position] = explode("&", $modules[$lowerCaseClassName]);
            }
            /* Get the position of the alias class name */
            if (false !== $position = array_search($lowerCaseClassAlias, $allExtendedClasses)) {
                $classChains[$position] = explode("&", $modules[$lowerCaseClassAlias]);
            }

            /* Notice that the array keys will be ordered, but do not necessarily start at 0 */
            ksort($classChains);
            $fullChain = [];
            if (1 === count($classChains)) {
                /**
                 * @var array $fullChain uses the one and only element of the array
                 */
                $fullChain = reset($classChains);
            }
            if (2 === count($classChains)) {
                /**
                 * @var array $fullChain merges the first and then the second array from the $classChains
                 */
                $fullChain = array_merge(reset($classChains), next($classChains));
            }
        }

        return $fullChain;
    }
575117
public function filterInactiveExtensions($classChain)
    {
        $disabledModules = $this->getDisabledModuleIds();

        foreach ($disabledModules as $disabledModuleId) {
            $classChain = $this->cleanModuleFromClassChain($disabledModuleId, $classChain);
        }

        return $classChain;
    }
1013777
protected function buildLevel($classname)
    {
        $parts = explode('.', $classname);
        
        $lastLevel = &$this->methods;
        foreach ($parts as $part) {
            $lastLevel[$part] = array();
            $lastLevel = &$lastLevel[$part];
        }
        
        return $lastLevel;
    }
620324
public function findAllByClass($className)
    {
        return array_values(array_filter($this->operationRunners, function (OperationRunner $operationRunner) use ($className) {
            return get_class($operationRunner) == $className || is_subclass_of($operationRunner, $className);
        }));
    }
1035555
public function shorten(ClassName $className)
    {
        if (!$className->isAbsolute()) {
            return $className;
        }

        foreach ($this->usedClasses() as $tuple) {
            list($usedClass, $as) = $tuple;
            if ($this->comparator()->equals($usedClass, $className)) {
                return $as;
            }
        }

        if (
            null !== $this->namespaceName() &&
            $this->namespaceName()->hasDescendant($className)
        ) {
            return $className->stripNamespace($this->namespaceName());
        }

        return $className;
    }
444855
protected function createProjectClass($className)
    {
        $arguments = func_get_args();
        array_shift($arguments);

        return $this->_projectLoader->createClass($className, $arguments);
    }
966052
public static function getFullClassname($classname)
    {
        if (is_array($classname)) {
            return  array_map(['BackBee\ClassContent\AbstractContent', 'getFullClassname'], $classname);
        }

        $isExcluded = self::isExcludedClassname($classname);

        try {
            class_exists($classname);
        } catch (ClassNotFoundException $ex) {
            return self::onUnknownClassname($classname.' is not a short classname of an AbstractClassContent instance.', $ex);
        }

        return ($isExcluded ? '!' : '').$classname;
    }
676987
public function reindex($className)
    {
        $this->checkImplementsSearchableInterface($className);
        $activeRecord = $this->activeRecordFactory->make($className);

        $records = $this->activeQueryChunker->chunk(
            $activeRecord->find(),
            self::CHUNK_SIZE,
            function ($activeRecordEntities) {
                return $this->getAlgoliaRecordsFromSearchableModelArray($activeRecordEntities);
            }
        );

        /* @var SearchableInterface $activeRecord */
        $indices = $this->initIndices($activeRecord);

        return $this->processIndices($indices, function (Index $index) use ($records) {
            return $this->reindexAtomically($index, $records);
        });
    }
1137280
public function getClassAliasName($className)
    {
        /*
         * Sanitize input: class names in namespaces should not, but may include a leading backslash
         */
        $className = ltrim($className, '\\');
        $classAlias = array_search($className, $this->classMap);

        if ($classAlias === false) {
            $classAlias = null;
        }

        return $classAlias;
    }
973140
public function loadClass($className)
    {
        if (self::typeExists($className)) {
            return true;
        }

        if ( ! $this->canLoadClass($className)) {
            return false;
        }

        require($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '')
               . str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className)
               . $this->fileExtension;

        return self::typeExists($className);
    }
84542
public static function query(string $className): QueryBuilder
    {
        $instance = self::getInstance($className);

        return Query::table($className)->className($className)->selectInstance($instance);
    }
825001
private function getJoinsFields(string $className): array
    {
        $fields = [];
        $associations = $this->entityManager->getClassMetadata($className)->associationMappings;
        foreach ($associations as $association) {
            $field = [
                'name' => $association['fieldName'],
                'type' => $this->types->getJoinOn($association['targetEntity']),
            ];

            $fields[] = $field;
        }

        return $fields;
    }
99453
public function addClass($classname)
    {
        $classArr = $this->getClassArray();
        $classArr[] = $classname;
        return $this->setClassArray($classArr);
    }
934098
public function createClassConstantReference(string $className): ClassConstFetch
    {
        $nameNode = new FullyQualified($className);

        return $this->builderFactory->classConstFetch($nameNode, 'class');
    }
1113030
public function loadClass($className)
    {
        $found = false;
        $nsSep = $this->namespace.$this->namespaceSeparator;
        if (null === $this->namespace || $nsSep === substr($className, 0, strlen($nsSep))) {
            $fileName = '';
            if (false !== ($lastNsPos = strripos($className, $this->namespaceSeparator))) {
                $namespace = substr($className, 0, $lastNsPos);
                $className = substr($className, $lastNsPos + 1);
                $fileName  = str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $namespace);
                $fileName .= DIRECTORY_SEPARATOR;
            }
            $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->fileExtension;
            $filePath  = stream_resolve_include_path($this->includePath . DIRECTORY_SEPARATOR . $fileName);
            if ($filePath) {
                /** @noinspection PhpIncludeInspection */
                require $filePath;
                $found = true;
            }
        }
        return $found;
    }
709271
public function create(string $className): array
    {
        $this->findIdentityField($className);

        $class = $this->metadata->getReflectionClass();
        $methods = $class->getMethods(ReflectionMethod::IS_PUBLIC);
        $fieldConfigurations = [];
        foreach ($methods as $method) {
            // Skip non-callable or non-instance
            if ($method->isAbstract() || $method->isStatic()) {
                continue;
            }

            // Skip non-getter methods
            $name = $method->getName();
            if (!preg_match($this->getMethodPattern(), $name)) {
                continue;
            }

            // Skip exclusion specified by user
            if ($this->isExcluded($method)) {
                continue;
            }

            $configuration = $this->methodToConfiguration($method);
            if ($configuration) {
                $fieldConfigurations[] = $configuration;
            }
        }

        return $fieldConfigurations;
    }
1021425
public static function extractNamespaces(ClassLoader $classLoader) {
    $namespaces = [];
    foreach ($classLoader->getPrefixes() as $namespace => $directories) {
      $namespaces[$namespace] = $directories[0];
    }
    foreach ($classLoader->getPrefixesPsr4() as $namespace => $directories) {
      $namespaces[$namespace] = $directories[0];
    }
    return new \ArrayIterator($namespaces);
  }