Pheasant\Database\ConnectionManager::connection PHP Method

connection() public method

Returns a connection
public connection ( $name )
    public function connection($name)
    {
        if ($name == 'default' && isset($this->_default)) {
            $name = $this->_default;
        }
        if (!isset($this->_connections[$name])) {
            throw new \Pheasant\Exception("No connection called {$name} registered");
        }
        $connection = $this->_connections[$name];
        // lazily build the connection
        if (is_string($connection)) {
            $connection = $this->_connections[$name] = $this->_buildConnection(new Dsn($connection));
        }
        return $connection;
    }