Bisna\Doctrine\Container::getConnection PHP Method

getConnection() public method

If DBAL Connection name could not be found, NameNotFoundException is thrown.
public getConnection ( string $connName = null ) : Doctrine\DBAL\Connection
$connName string Optional DBAL Connection name
return Doctrine\DBAL\Connection DBAL Connection
    public function getConnection($connName = null)
    {
        $connName = $connName ?: $this->defaultConnection;
        // Check if DBAL Connection has not yet been initialized
        if (!isset($this->connections[$connName])) {
            // Check if DBAL Connection is configured
            if (!isset($this->configuration['dbal'][$connName])) {
                throw new Exception\NameNotFoundException("Unable to find Doctrine DBAL Connection '{$connName}'.");
            }
            $this->connections[$connName] = $this->startDBALConnection($this->configuration['dbal'][$connName]);
            unset($this->configuration['dbal'][$connName]);
        }
        return $this->connections[$connName];
    }