本文整理汇总了PHP中Doctrine\ORM\ORMException::unknownEntityNamespace方法的典型用法代码示例。如果您正苦于以下问题:PHP ORMException::unknownEntityNamespace方法的具体用法?PHP ORMException::unknownEntityNamespace怎么用?PHP ORMException::unknownEntityNamespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\ORM\ORMException
的用法示例。
在下文中一共展示了ORMException::unknownEntityNamespace方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAliasNamespace
/**
* 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);
}
示例2: getAliasNamespace
/**
* {@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);
}
示例3: getAliasNamespace
/**
* 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);
}
示例4: getAliasNamespace
/**
* @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);
}
示例5: getEntityNamespace
/**
* 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], '\\');
}
开发者ID:MarS2806,项目名称:Zend-Framework--Doctrine-ORM--PHPUnit--Ant--Jenkins-CI--TDD-,代码行数:14,代码来源:Configuration.php
示例6: getAliasNamespace
/**
* 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);
}