public function AbstractManagerRegistry::getConnection in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php \Doctrine\Common\Persistence\AbstractManagerRegistry::getConnection()
Gets the named connection.
Parameters
string $name The connection name (null for the default one).:
Return value
object
Overrides ConnectionRegistry::getConnection
File
- vendor/
doctrine/ common/ lib/ Doctrine/ Common/ Persistence/ AbstractManagerRegistry.php, line 118
Class
- AbstractManagerRegistry
- Abstract implementation of the ManagerRegistry contract.
Namespace
Doctrine\Common\PersistenceCode
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]);
}