/** * Resolves a registered namespace alias to the full namespace. * * This method looks for the alias in all registered entity managers. * * @see \Doctrine\ORM\Configuration::getEntityNamespace * @param string $alias The alias * @throws \Doctrine\ORM\ORMException * @return string The full namespace */ public function getAliasNamespace($alias) { foreach (array_keys($this->getManagers()) as $name) { try { return $this->getManager($name)->getConfiguration()->getEntityNamespace($alias); } catch (ORMException $e) { } } throw ORMException::unknownEntityNamespace($alias); }
/** * {@inheritdoc} */ public function getAliasNamespace($alias) { /** @var EntityManager $entityManager */ foreach ([$this->entityManager] as $entityManager) { try { return $entityManager->getConfiguration()->getEntityNamespace($alias); } catch (ORMException $e) { } } throw ORMException::unknownEntityNamespace($alias); }
/** * Resolves a registered namespace alias to the full namespace. * * This method looks for the alias in all registered object managers. * * @param string $alias The alias. * @return string The full namespace. * @throws ORMException */ public function getAliasNamespace($alias) { foreach (array_keys($this->getManagers()) as $name) { try { if (($em = $this->getManager($name)) instanceof EntityManager) { return $em->getConfiguration()->getEntityNamespace($alias); } } catch (ORMException $e) { // If any exception is throw when attempting to retrieve then have our custom one thrown } } throw ORMException::unknownEntityNamespace($alias); }
/** * @param string $alias * @return string * @throws ORMException */ public function getAliasNamespace($alias) { foreach ($this->getManagerNames() as $name) { try { return $this->getManager($name)->getConfiguration()->getEntityNamespace($alias); } catch (ORMException $e) { // throw the exception only if no manager can solve it } } throw ORMException::unknownEntityNamespace($alias); }
/** * Resolves a registered namespace alias to the full namespace. * * @param string $entityNamespaceAlias * @return string * @throws MappingException */ public function getEntityNamespace($entityNamespaceAlias) { if (!isset($this->_attributes['entityNamespaces'][$entityNamespaceAlias])) { throw ORMException::unknownEntityNamespace($entityNamespaceAlias); } return trim($this->_attributes['entityNamespaces'][$entityNamespaceAlias], '\\'); }
/** * Resolves a registered namespace alias to the full namespace. * * This method looks for the alias in all registered object managers. * * @param string $alias The alias. * @return string The full namespace. * @throws ORMException * @throws \InvalidArgumentException */ public function getAliasNamespace($alias) { foreach ($this->getManagerNames() as $name) { try { /* @var $manager \Doctrine\ORM\EntityManagerInterface */ $manager = $this->getManager($name); return $manager->getConfiguration()->getEntityNamespace($alias); } catch (ORMException $e) { // throw the exception only if no manager can solve it } } throw ORMException::unknownEntityNamespace($alias); }