diff --git a/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php b/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php index 5f7d70410..2a68112b3 100644 --- a/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php +++ b/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php @@ -38,16 +38,15 @@ class DefaultEntityListenerResolver implements EntityListenerResolver */ public function clear($className = null) { - if ($className !== null) { - - if (isset($this->instances[$className = trim($className, '\\')])) { - unset($this->instances[$className]); - } + if ($className === null) { + $this->instances = array(); return; } - $this->instances = array(); + if (isset($this->instances[$className = trim($className, '\\')])) { + unset($this->instances[$className]); + } } /**