Gets the named connection.
string $name The connection name (null for the default one):
object
Overrides ConnectionRegistry::getConnection
public function getConnection($name = null) {
if (null === $name) {
$name = $this->defaultConnection;
}
if (!isset($this->connections[$name])) {
throw new \InvalidArgumentException(sprintf('Doctrine %s Connection named "%s" does not exist.', $this->name, $name));
}
return $this
->getService($this->connections[$name]);
}