From bd608c8bfabe00ad2782d168aaeea747d71dfa46 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 3 May 2011 07:31:44 +0200 Subject: [PATCH] [DoctrineBundle] removed redundant check --- src/Symfony/Bundle/DoctrineBundle/Registry.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Symfony/Bundle/DoctrineBundle/Registry.php b/src/Symfony/Bundle/DoctrineBundle/Registry.php index 13641cf59d..2832dae518 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Registry.php +++ b/src/Symfony/Bundle/DoctrineBundle/Registry.php @@ -32,15 +32,7 @@ class Registry $this->container = $container; $this->connections = $connections; $this->entityManagers = $entityManagers; - - if (!isset($this->connections[$defaultConnection])) { - throw new \LogicException(sprintf('Default connection "%s" is not defined.', $defaultConnection)); - } $this->defaultConnection = $defaultConnection; - - if (!isset($this->entityManagers[$defaultEntityManager])) { - throw new \LogicException(sprintf('Default entity manager "%s" is not defined.', $defaultEntityManager)); - } $this->defaultEntityManager = $defaultEntityManager; } @@ -64,7 +56,7 @@ class Registry public function getConnection($name = null) { if (null === $name) { - return $this->container->get($this->connections[$this->defaultConnection]); + $name = $this->defaultConnection; } if (!isset($this->connections[$name])) { @@ -104,7 +96,7 @@ class Registry public function getEntityManager($name = null) { if (null === $name) { - return $this->container->get($this->entityManagers[$this->defaultEntityManager]); + $name = $this->defaultEntityManager; } if (!isset($this->entityManagers[$name])) {