Resolves a registered namespace alias to the full namespace.

@param string $entityNamespaceAlias
@return string
@throws MappingException
162085
public function getEntityNamespace($entityNamespaceAlias)
    {
        if ( ! isset($this->attributes['entityNamespaces'][$entityNamespaceAlias])) {
            throw OXMException::unknownEntityNamespace($entityNamespaceAlias);
        }

        return trim($this->attributes['entityNamespaces'][$entityNamespaceAlias], '\\');
    }
291787
public function toNamespacedString($namespace, array $aliased_classes, $this_class, $use_phpdoc_format)
    {
        $intersection_types = $this->getNamespacedIntersectionTypes(
            $namespace,
            $aliased_classes,
            $this_class,
            $use_phpdoc_format
        );

        if ($this->value === 'static') {
            return 'static';
        }

        if ($this->value === $this_class) {
            return 'self' . $intersection_types;
        }

        if ($namespace && stripos($this->value, $namespace . '\\') === 0) {
            return preg_replace(
                '/^' . preg_quote($namespace . '\\') . '/i',
                '',
                $this->value
            ) . $intersection_types;
        }

        if (!$namespace && stripos($this->value, '\\') === false) {
            return $this->value . $intersection_types;
        }

        if (isset($aliased_classes[strtolower($this->value)])) {
            return $aliased_classes[strtolower($this->value)] . $intersection_types;
        }

        return '\\' . $this->value . $intersection_types;
    }
88940
public function getNamedNativeQuery($queryName)
    {
        if ( ! isset($this->namedNativeQueries[$queryName])) {
            throw MappingException::queryNotFound($this->name, $queryName);
        }

        return $this->namedNativeQueries[$queryName];
    }
1334103
public function registerXPathNamespaces($namespaces)
    {
        // Convenience method to add multiple namespaces at once
        foreach ($namespaces as $prefix => $uri) {
            $this->registerXPathNamespace($prefix, $uri);
        }
    }
497406
public function getNamespaceByName( $name ) {
		$result = $this->getNamespaceResult()['query'];
		foreach ( $result['namespaces'] as $nsInfo ) {
			if ( ( !empty( $nsInfo['canonical'] ) && $nsInfo['canonical'] === $name ) ||
				$nsInfo['*'] === $name ) {
				return $this->createNamespaceFromQuery( $nsInfo, $result['namespacealiases'] );
			}
		}
		foreach ( $result['namespacealiases'] as $alias ) {
			if ( $alias['*'] === $name && !empty( $result['namespaces'][$alias['id']] ) ) {
				return $this->createNamespaceFromQuery(
					$result['namespaces'][$alias['id']],
					$result['namespacealiases']
				);
			}
		}
		return null;
	}
1154300
public function getAliasNamespace($alias)
    {
        foreach ($this->getManagerNames() as $name) {
            try {
                return $this->getManager($name)->getConfiguration()->getEntityNamespace($alias);
            } catch (ORMException $e) {
            }
        }

        throw ORMException::unknownEntityNamespace($alias);
    }
1322532
private function resolve($entity)
    {
        foreach ($this->namespaces as $namespace) {
            $className = $namespace . '\\' . ucfirst($entity);
            if (class_exists($className)) {
                return $className;
            }
        }
        return null;
    }
884387
private function fetchNamespaces (NamespaceRegistry $entryNamespaces) : array
    {
        $namespaces = [];

        foreach ($entryNamespaces as $namespace => $path)
        {
            $namespaces[$namespace] = $this->makePathRelative($path);
        }

        return $namespaces;
    }
1163210
function aliasGetName($nameOrAlias) {
    if ('\\' === $nameOrAlias[0]) {
      return substr($nameOrAlias, 1);
    }
    elseif (NULL !== $this->namespaceName) {
      return $this->namespaceName . '\\' . $nameOrAlias;
    }
    else {
      return $nameOrAlias;
    }
  }
780617
public function toNamespacedString($namespace, array $aliased_classes, $this_class, $use_phpdoc_format)
    {
        if ($this->as === 'object') {
            return 'class-string';
        }

        if ($namespace && stripos($this->as, $namespace . '\\') === 0) {
            return 'class-string<' . preg_replace(
                '/^' . preg_quote($namespace . '\\') . '/i',
                '',
                $this->as
            ) . '>';
        }

        if (!$namespace && stripos($this->as, '\\') === false) {
            return 'class-string<' . $this->as . '>';
        }

        if (isset($aliased_classes[strtolower($this->as)])) {
            return 'class-string<' . $aliased_classes[strtolower($this->as)] . '>';
        }

        return 'class-string<\\' . $this->as . '>';
    }
311944
public function resolve($name)
    {
        if (class_exists($name)) {
            return $name;
        }

        $name = static::normalise($name);

        $namespaces = clone $this->namespaces;

        $this->registerDefaultNamespace($namespaces);

        foreach (clone $namespaces as $ns) {
            $class = $ns . '\\' . $name;

            if (class_exists($class = $this->resolveClassAlias($class))) {
                if ($this->baseClass && !is_subclass_of($class, $this->baseClass)) {
                    throw new \DomainException(sprintf(
                        'Class: "%s" should be sub class of %s',
                        $class,
                        $this->baseClass
                    ));
                }

                return $class;
            }
        }

        throw new \DomainException(sprintf(
            'Can not find any classes with name: "%s" in package: "%s", namespaces: ( %s ).',
            $name,
            $this->package->getName(),
            implode(" |\n ", $namespaces->toArray())
        ));
    }
1311899
private static function mapRootAliases(array $rootAliases, array $rootEntities): array
    {
        $aliasMap = array_combine($rootAliases, $rootEntities);
        if (false === $aliasMap) {
            throw new \LogicException('Number of root aliases and root entities do not match.');
        }

        return $aliasMap;
    }
563857
public function getMappingByAlias(string $alias) : Mapping
    {
        foreach ($this->mappings as $mapping) {
            if (0 === strcasecmp($alias, $mapping->getClassAlias())) {
                return $mapping;
            }
        }

        return Mapping::null();
    }
569703
function getPrefixFromNamespace($ns)
    {
        foreach ($this->namespaces as $p => $n) {
            if ($ns == $n || $ns == $p) {
                $this->usedNamespaces[$p] = $n;

                return $p;
            }
        }

        return FALSE;
    }
1154700
public function findNamespace(string $namespace): string
	{
		$allNamespaces = $this->getNamespaces();

		$expr = preg_replace_callback(
			'{([^:]+|)}',
			function ($matches)
			{
				return preg_quote($matches[1]) . '[^:]*';
			},
			$namespace
		);

		$namespaces = preg_grep('{^' . $expr . '}', $allNamespaces);

		if (empty($namespaces))
		{
			throw new NamespaceNotFoundException(sprintf('There are no commands defined in the "%s" namespace.', $namespace));
		}

		$exact = \in_array($namespace, $namespaces, true);

		if (\count($namespaces) > 1 && !$exact)
		{
			throw new NamespaceNotFoundException(sprintf('The namespace "%s" is ambiguous.', $namespace));
		}

		return $exact ? $namespace : reset($namespaces);
	}
598667
public function resolve($name)
    {
        $name = array_key_exists($name, $this->aliasMap) ? $this->aliasMap[$name] : $name;

        return $this->a->resolve($name);
    }
1062477
public function resolveAlias($name)
    {
        if (isset($this->aliases[$name])) {
            return $this->aliases[$name];
        }

        return $name;
    }