From 757a9529f8124930f83007aaa490e2c0179c9e98 Mon Sep 17 00:00:00 2001 From: guilhermeblanco Date: Wed, 10 Mar 2010 20:38:20 +0000 Subject: [PATCH] [2.0] Fixed issue with Proxy classes that was silently failing to load correspondent Entity. --- lib/Doctrine/ORM/EntityNotFoundException.php | 17 +++++++++++++++++ lib/Doctrine/ORM/Proxy/ProxyFactory.php | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 lib/Doctrine/ORM/EntityNotFoundException.php diff --git a/lib/Doctrine/ORM/EntityNotFoundException.php b/lib/Doctrine/ORM/EntityNotFoundException.php new file mode 100644 index 000000000..ae478be4d --- /dev/null +++ b/lib/Doctrine/ORM/EntityNotFoundException.php @@ -0,0 +1,17 @@ + { private function _load() { if (!$this->__isInitialized__ && $this->_entityPersister) { $this->__isInitialized__ = true; - $this->_entityPersister->load($this->_identifier, $this); + if ($this->_entityPersister->load($this->_identifier, $this) === null) { + throw new \Doctrine\ORM\EntityNotFoundException(); + } unset($this->_entityPersister); unset($this->_identifier); }