[DoctrineBridge] normalized class names in the ORM type guesser

This commit is contained in:
Fabien Potencier 2013-11-29 14:28:14 +01:00
parent 9ec6a9c3dc
commit a1b9c2ed60

View File

@ -19,6 +19,7 @@ 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\Common\Util\ClassUtils;
class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface
{
@ -161,6 +162,9 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface
protected function getMetadata($class)
{
// normalize class name
$class = ClassUtils::getRealClass(ltrim($class, '\\'));
if (array_key_exists($class, $this->cache)) {
return $this->cache[$class];
}