@param string|null $alias The connection's alias

@return \Neoxygen\NeoClient\Connection\Connection The requested connection

@throws InvalidConnectionException When the connection does not exist
352419
public function getConnection($alias = null)
    {
        $message = null;

        if (null === $alias && empty($this->connections)) {
            $message = sprintf('There is no connection configured');
        } elseif (null !== $alias && !array_key_exists($alias, $this->connections)) {
            $message = sprintf('The connection with alias "%s" is not configured', $alias);
        }
        if ($message) {
            throw new InvalidConnectionException($message);
        }

        if (null === $alias) {
            return $this->getDefaultConnection();
        }

        return $this->connections[$alias];
    }
1075100
public static function getRouteByAlias($alias)
    {
        //No routes
        if (empty(self::$routes)) {
            return;
        }

        //Search in the map
        $route = null;

        if (($index = array_search($alias, array_column(self::$routes, 'alias'))) !== false) {
            $route = self::$routes[$index]['route'];
        }

        return $route;
    }
1331001
public static function getInstance($alias = null)
	{
		if('' === static::$driverName)
		{
			static::init();
		}
		if(null === $alias)
		{
			$alias = self::defaultAlias();
		}
		if (isset(self::$instances[static::$driverName][$alias]))
		{
			return self::$instances[static::$driverName][$alias];
		}
		else
		{
			$option = Config::get('@.APP_' . strtoupper(static::$driverName) . '.' . $alias);
			if(false === $option)
			{
				return null;
			}
			else
			{
				return self::create($option,$alias);
			}
		}
	}
293972
public function connection($name = null)
    {
        if (is_null($name)) {
            $name = $this->getDefaultConnection();
        }

        if (! isset($this->connections[$name])) {
            throw new InvalidArgumentException("Connection [{$name}] is not registered.");
        }

        return $this->connections[$name];
    }
1221723
public function getCardByAlias($alias)
    {
        if (!array_key_exists($alias, $this->aliases)) {
            throw new Exception\NoSuchAliasException(sprintf('Alias "%s" has not been assigned to any cards.', $alias));
        }

        return $this->getCard($this->aliases[$alias]);
    }
645688
public function getTableByAlias($alias)
    {
        return $this->hasTableAlias($alias) ? $this->getExpression($this->getHash($alias)) : null;
    }
516609
public function useAlias($alias)
    {
        $aliasGetter = 'get'.ucfirst($alias).'Alias';

        if (! method_exists($this->indexConfigurator, $aliasGetter)) {
            throw new Exception(sprintf(
                'The index configurator %s doesn\'t have getter for the %s alias.',
                get_class($this->indexConfigurator),
                $alias
            ));
        }

        $this->payload['index'] = call_user_func([$this->indexConfigurator, $aliasGetter]);

        return $this;
    }
855864
public function getConnection()
    {
        $repositoryConfig = $this->repositoryConfigurationProvider->getRepositoryConfig();
        // Taking provided connection name if any.
        // Otherwise, just fallback to the default connection.

        if (isset($repositoryConfig['search']['connection'])) {
            $doctrineConnectionId = sprintf('doctrine.dbal.%s_connection', $repositoryConfig['search']['connection']);
        } else {
            // "database_connection" is an alias to the default connection, set up by DoctrineBundle.
            $doctrineConnectionId = 'database_connection';
        }

        if (!$this->container->has($doctrineConnectionId)) {
            throw new InvalidArgumentException(
                "Invalid Doctrine connection '{$repositoryConfig['search']['connection']}' for repository '{$repositoryConfig['alias']}'." .
                'Valid connections are ' . implode(', ', array_keys($this->container->getParameter('doctrine.connections')))
            );
        }

        return $this->container->get($doctrineConnectionId);
    }
1153140
public function getConnection($name)
    {
        if (!$this->hasConnection($name)) {
            throw new \InvalidArgumentException(sprintf('The connection "%s" does not exist.', $name));
        }

        return $this->connections[$name];
    }
727676
public function alias($alias = null)
    {
        if ($alias === null) {
            return $this->_alias;
        }
        $this->_alias = $alias;

        return $this;
    }
38008
protected function
	GetConnectionConfig($Alias) {
	/*//
	@return Nether\Database\Connection
	fetch the specified configuration. if none is found then it will throw an
	exception instead.
	//*/

		$Config = Nether\Option::Get('nether-database-connections');

		if(!array_key_exists($Alias,$Config))
		throw new Nether\Database\Error\InvalidConfig($Alias);

		if($Config[$Alias] instanceof Nether\Database\Connection)
		return $Config[$Alias];

		return new Nether\Database\Connection($Config[$Alias]);
	}
499753
public function getAuthenticate($alias)
    {
        if (empty($this->_authenticateObjects)) {
            $this->constructAuthenticate();
        }

        return isset($this->_authenticateObjects[$alias]) ? $this->_authenticateObjects[$alias] : null;
    }
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];
	}
563857
public function getMappingByAlias(string $alias) : Mapping
    {
        foreach ($this->mappings as $mapping) {
            if (0 === strcasecmp($alias, $mapping->getClassAlias())) {
                return $mapping;
            }
        }

        return Mapping::null();
    }
1002142
public function resolveAlias(string $alias)
    {
        if (isset($this->aliases[$alias]))
            return $this->aliases[$alias];

        if (empty($this->parent_scope))
            return null;

        return $this->parent_scope->resolveAlias($alias);
    }
918905
public function addAlias($alias = null)
    {
        return (new AuthorizationBuilder(TransactionType::ALIAS, $this))
            ->withAlias(AliasAction::ADD, $alias);
    }
353312
public function setAlias($alias)
    {
        $aliasManipulator = new AliasManipulator($this->originalDir, $this->alias);
        $aliasManipulator->setAlias($alias);

        return $aliasManipulator;
    }