From 4b061a0e4c57c43f765bf2cc183cc72745269487 Mon Sep 17 00:00:00 2001 From: Per Persson Date: Tue, 11 Feb 2014 23:40:38 +0100 Subject: [PATCH 1/3] Add class name as argument. --- lib/Doctrine/ORM/EntityNotFoundException.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/EntityNotFoundException.php b/lib/Doctrine/ORM/EntityNotFoundException.php index 710853deb..18278f715 100644 --- a/lib/Doctrine/ORM/EntityNotFoundException.php +++ b/lib/Doctrine/ORM/EntityNotFoundException.php @@ -30,8 +30,8 @@ class EntityNotFoundException extends ORMException /** * Constructor. */ - public function __construct() + public function __construct($class) { - parent::__construct('Entity was not found.'); + parent::__construct("Entity of type '{$class}' was not found."); } } From 7ef106300795249151ebda2bf61e266a0e120972 Mon Sep 17 00:00:00 2001 From: Per Persson Date: Tue, 11 Feb 2014 23:44:24 +0100 Subject: [PATCH 2/3] Pass class name to constructor. --- lib/Doctrine/ORM/Proxy/ProxyFactory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index a190fc896..a23df8922 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -142,7 +142,7 @@ class ProxyFactory extends AbstractProxyFactory $proxy->__setCloner($cloner); $proxy->__setInitialized(false); - throw new EntityNotFoundException(); + throw new EntityNotFoundException($classMetadata->getName()); } }; } @@ -173,7 +173,7 @@ class ProxyFactory extends AbstractProxyFactory $proxy->__setCloner($cloner); $proxy->__setInitialized(false); - throw new EntityNotFoundException(); + throw new EntityNotFoundException($classMetadata->getName()); } }; } @@ -202,7 +202,7 @@ class ProxyFactory extends AbstractProxyFactory $original = $entityPersister->loadById($classMetadata->getIdentifierValues($proxy)); if (null === $original) { - throw new EntityNotFoundException(); + throw new EntityNotFoundException($classMetadata->getName()); } foreach ($class->getReflectionClass()->getProperties() as $property) { From 3543ccea7f100da8cd464407e69994884bcd7626 Mon Sep 17 00:00:00 2001 From: Per Persson Date: Tue, 11 Feb 2014 23:48:31 +0100 Subject: [PATCH 3/3] Pass class name to constructor. --- lib/Doctrine/ORM/UnitOfWork.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index a61630d1f..6c5f2e400 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1837,7 +1837,7 @@ class UnitOfWork implements PropertyChangedListener // If the identifier is ASSIGNED, it is NEW, otherwise an error // since the managed entity was not found. if ( ! $class->isIdentifierNatural()) { - throw new EntityNotFoundException; + throw new EntityNotFoundException($class->getName()); } $managedCopy = $this->newInstance($class);