diff --git a/src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php b/src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php index 8acedece6a..be3992bad0 100644 --- a/src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php +++ b/src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php @@ -49,7 +49,7 @@ class DoctrineBundle extends Bundle $className = substr($class, strlen($namespace) +1); $file = $dir.DIRECTORY_SEPARATOR.$className.'.php'; - if (!file_exists($file)) { + if (!file_exists($file) && $this->container->getParameter('kernel.debug')) { $originalClassName = substr($className, 0, -5); $registry = $container->get('doctrine');