src/IlluminateRegistry.php
public function getConnection($name = null)
    {
        $name = $name ?: $this->getDefaultConnectionName();

        if (!$this->connectionExists($name)) {
            throw new InvalidArgumentException(sprintf('Doctrine Connection named "%s" does not exist.', $name));
        }

        if (isset($this->connectionsMap[$name])) {
            return $this->connectionsMap[$name];
        }

        return $this->connectionsMap[$name] = $this->getService(
            $this->getConnectionBindingName($this->connections[$name])
        );
    }
public function getConnection($name = null)
    {
        $name = $name ?: $this->getDefaultConnectionName();

        if (!$this->connectionExists($name)) {
            throw new InvalidArgumentException(sprintf('Doctrine Connection named "%s" does not exist.', $name));
        }

        if (isset($this->connectionsMap[$name])) {
            return $this->connectionsMap[$name];
        }

        return $this->connectionsMap[$name] = $this->getService(
            $this->getConnectionBindingName($this->connections[$name])
        );
    }
public function getConnection ( $ name = null ) { $ name = $ name ? : $ this -> getDefaultConnectionName ( ) ; if ( ! $ this -> connectionExists ( $ name ) ) { throw new InvalidArgumentException ( sprintf ( 'Doctrine Connection named "%s" does not exist.' , $ name ) ) ; } if ( isset ( $ this -> connectionsMap [ $ name ] ) ) { return $ this -> connectionsMap [ $ name ] ; } return $ this -> connectionsMap [ $ name ] = $ this -> getService ( $ this -> getConnectionBindingName ( $ this -> connections [ $ name ] ) ) ; }
Gets the named connection.

@param string $name The connection name (null for the default one).

@return object
Gets the named connection .