src/ConnectionManager.php
public function getConnection($name = ''): QueryBuilderInterface
	{
		// If the parameter is a string, use it as an array index
		if (is_scalar($name) && isset($this->connections[$name]))
		{
			return $this->connections[$name];
		}
		else if (empty($name) && ! empty($this->connections)) // Otherwise, return the last one
		{
			return end($this->connections);
		}

		// You should actually connect before trying to get a connection...
		throw new InvalidArgumentException('The specified connection does not exist');
	}
public function getConnection($name = ''): QueryBuilderInterface
	{
		// If the parameter is a string, use it as an array index
		if (is_scalar($name) && isset($this->connections[$name]))
		{
			return $this->connections[$name];
		}
		else if (empty($name) && ! empty($this->connections)) // Otherwise, return the last one
		{
			return end($this->connections);
		}

		// You should actually connect before trying to get a connection...
		throw new InvalidArgumentException('The specified connection does not exist');
	}
public function getConnection ( $ name = '' ) : QueryBuilderInterface { // If the parameter is a string, use it as an array index if ( is_scalar ( $ name ) && isset ( $ this -> connections [ $ name ] ) ) { return $ this -> connections [ $ name ] ; } else if ( empty ( $ name ) && ! empty ( $ this -> connections ) ) // Otherwise, return the last one { return end ( $ this -> connections ) ; } // You should actually connect before trying to get a connection... throw new InvalidArgumentException ( 'The specified connection does not exist' ) ; }
Returns the connection specified by the name given

@param string|array|object $name
@return QueryBuilderInterface
@throws InvalidArgumentException
Returns the connection specified by the name given