Get an alias for an identifier

@param  string  The alias
@return mixed   The class indentifier or identifier object, or NULL if no alias was found.
334443
public static function getAlias($alias)
    {
        return isset(self::$_aliases[$alias]) ? self::$_aliases[$alias] : null;
    }
563857
public function getMappingByAlias(string $alias) : Mapping
    {
        foreach ($this->mappings as $mapping) {
            if (0 === strcasecmp($alias, $mapping->getClassAlias())) {
                return $mapping;
            }
        }

        return Mapping::null();
    }
789391
public function getAlias($name = null)
    {
        if (is_null($name)) {
            return $this->alias;
        }

        return isset($this->alias[$name]) ? $this->alias[$name] : null;
    }
473696
public function findByIdentifier($identifier)
    {
        $object = $this->persistenceManager->getObjectByIdentifier($identifier, $this->entityClassName);
        if ($object === null) {
            foreach ($this->addedResources as $addedResource) {
                if ($this->persistenceManager->getIdentifierByObject($addedResource) === $identifier) {
                    $object = $addedResource;
                    break;
                }
            }
        }

        return $object;
    }
676422
public function getId($alias)
    {
        if (!isset($this->aliases[$alias])) {
            return null;
        }

        $id = $this->aliases[$alias];
        while (isset($this->aliases[$id])) {
            $id = $this->aliases[$id];
        }

        return $id;
    }
592411
public static function getComponentWithIdentifier(string $identifier)
    {
        $components = self::getComponents();
        foreach ($components as $component) {
            if (empty($component->getIdentifier())) {
                continue;
            }
            
            if ($component->getIdentifier() == $identifier) {
                return $component;
            }
        }
        
        return null;
    }
845361
public function getAlias()
    {
        if ($this->_alias === null) {
            throw new Exception('The $alias property can not be null and must be set.');
        }
        
        return $this->item->alias . '/' . $this->_alias;
    }
356924
public static function findDefaultClass($identifier)
    {
        $strIdentifier = (string) $identifier;

        if (isset(self::$_defaults[$strIdentifier])) {
            $classname = self::$_defaults[$strIdentifier];

            if ($classname === false || class_exists($classname)) {
                return $classname;
            }
        }

        $classbase = 'Lib'.ucfirst($identifier->package).AnInflector::implode($identifier->path);
        $loader = AnService::get('anahita:loader');
        $classname = $classbase.ucfirst($identifier->name);

        if (!class_exists($classname)) {
            $classname = $classbase.'Default';

            if (!class_exists($classname)) {
                $classname = false;
            }
        }

        if ($classname === false) {
            if (isset(self::$_identifiers[$strIdentifier])) {
                $config = self::$_identifiers[$strIdentifier];

                if (isset($config['default'])) {
                    $classes = array_unique($config['default']);
                } else {
                    $classes = get_prefix($config['prefix'], $config['name']);

                    if (isset($config['fallback'])) {
                        $classes[] = $config['fallback'];
                    }
                }
                foreach ($classes as $class) {
                    //make sure to find  path first
                    //then try to load it
                    if ($loader->findPath($class, $identifier->basepath) &&
                        $loader->loadClass($class, $identifier->basepath)
                           ) {
                        $classname = $class;
                        break;
                    }
                }
            }
        }

        self::setDefaultClass($strIdentifier, $classname);

        return $classname;
    }
1204510
public function find($identifier)
    {
        $this->stringHelper->validate($identifier);

        foreach ($this->symbols as $symbol) {
            if (in_array($identifier, $symbol->getIdentifiers())) {
                return $symbol;
            }
        }

        return null;
    }
584209
public function getAlias($alias)
    {
        return isset($this->_aliases[$alias]) ? $this->_aliases[$alias] : $alias;
    }
791334
public function single($alias)
	{
		$alias = strtolower($alias);

		// Return the existing object if it exists.
		if (! empty($this->instances[$alias]) && is_object($this->instances[$alias]))
		{
			return $this->instances[$alias];
		}

		// Die if we don't know what class to use.
		if (empty($this->services[$alias]))
		{
			throw new \InvalidArgumentException('Unable to find class with alias: '. $alias);
		}

		$instance = $this->make($alias, true);

		$this->instances[$alias] =& $instance;

		return $this->instances[$alias];
	}
647321
public function resolveClassName($alias)
    {
        // Make sure we have string, type-cast Contenttype if needed.
        $alias = (string) $alias;

        if (class_exists($alias)) {
            return $alias;
        }

        if (array_key_exists($alias, $this->aliases)) {
            $class = $this->aliases[$alias];
            if (class_exists($class)) {
                return $class;
            }
        }
        if (array_key_exists($alias, $this->defaultAliases)) {
            $class = $this->defaultAliases[$alias];
            if (class_exists($class)) {
                return $class;
            }
        }
        if (array_key_exists($alias, $this->defaultAliases)) {
            $class = $this->defaultAliases[$alias];
            if (class_exists($class)) {
                return $class;
            }
        }

        return $this->fallbackEntity;
    }
206557
public function get_method($identifier)
    {
        extract($identifier);

        $key = $class.':'.$method;

        // create a unique field name
        $field = $this->_hash($args);

        $result = $this->redis->hget($key, $field);

        return is_null($result) ?
            array('status' => false, 'data' => null) :
            array('status' => true, 'data' => $result);
    }
956989
public function resolve($alias): ?Type
    {
        if (null === $alias) {
            return null;
        }

        if (!isset($this->cache[$alias])) {
            $type = $this->string2Type($alias);
            $this->cache[$alias] = $type;
        }

        return $this->cache[$alias];
    }
1351111
public function getInstance($alias = null)
    {
        if (!$alias && !$this->mainAlias) {
            $namespace = explode('\\', $this->_entityName);
            $alias = strtolower(end($namespace));
            $this->mainAlias = $alias;
        } elseif ($alias) {
            $this->mainAlias = $alias;
        }

        return $this->qb ? $this->qb : $this->qb = $this->createQueryBuilder($this->mainAlias);
    }
1045971
public function getParameter($identifier)
    {
        return isset($this->parameters[$identifier]) ? $this->parameters[$identifier] : null;
    }
267975
public function getAlias(): ?string
    {
        return isset($this->statements['aliases']) === true ? array_values($this->statements['aliases'])[0] : null;
    }