Permalink
Browse files

[DoctrineBundle] removed redundant check

  • Loading branch information...
1 parent d3f5fdf commit 377b7e1d7974a725293bbd7741d41c3feb1da2a7 @fabpot fabpot committed May 3, 2011
Showing with 2 additions and 10 deletions.
  1. +2 −10 Registry.php
View
@@ -32,15 +32,7 @@ public function __construct(ContainerInterface $container, array $connections, a
$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 @@ public function getDefaultConnectionName()
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 @@ public function getDefaultEntityManagerName()
public function getEntityManager($name = null)
{
if (null === $name) {
- return $this->container->get($this->entityManagers[$this->defaultEntityManager]);
+ $name = $this->defaultEntityManager;
}
if (!isset($this->entityManagers[$name])) {

0 comments on commit 377b7e1

Please sign in to comment.