From 8f99be39aba354170744a498b423ea8b61fa2704 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Mon, 16 Jul 2012 16:48:22 +0200 Subject: [PATCH] [DoctrineBridge] Fixed the type guesser for doctrine 2.3 --- src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php index 07a37d5ae6..0123d221ce 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php +++ b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php @@ -12,11 +12,12 @@ namespace Symfony\Bridge\Doctrine\Form; use Doctrine\Common\Persistence\ManagerRegistry; +use Doctrine\Common\Persistence\Mapping\MappingException; +use Doctrine\ORM\Mapping\MappingException as LegacyMappingException; use Symfony\Component\Form\FormTypeGuesserInterface; use Symfony\Component\Form\Guess\Guess; use Symfony\Component\Form\Guess\TypeGuess; use Symfony\Component\Form\Guess\ValueGuess; -use Doctrine\ORM\Mapping\MappingException; class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface { @@ -145,6 +146,8 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface return $this->cache[$class] = array($em->getClassMetadata($class), $name); } catch (MappingException $e) { // not an entity or mapped super class + } catch (LegacyMappingException $e) { + // not an entity or mapped super class, using Doctrine ORM 2.2 } } }