public function getManager($name) { if (array_key_exists($name, $this->managers)) { return $this->managers[$name]; } else { throw new UnexpectedValueException("Entity manager is not registered: " . $name); } }