You are here

public function AbstractManagerRegistry::getManager in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php \Doctrine\Common\Persistence\AbstractManagerRegistry::getManager()

Throws

\InvalidArgumentException

Overrides ManagerRegistry::getManager

File

vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php, line 173

Class

AbstractManagerRegistry
Abstract implementation of the ManagerRegistry contract.

Namespace

Doctrine\Common\Persistence

Code

public function getManager($name = null) {
  if (null === $name) {
    $name = $this->defaultManager;
  }
  if (!isset($this->managers[$name])) {
    throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name));
  }
  return $this
    ->getService($this->managers[$name]);
}