From 67006e0a441a5207081d1d0a8e28475bb343d356 Mon Sep 17 00:00:00 2001 From: Konstantin Myakshin Date: Thu, 20 Aug 2015 13:37:46 +0300 Subject: [PATCH] Allow pass instances of EntityManager as "em" option --- src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php index 3b4abc26689f6..5e843dca22d7a 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -143,6 +143,10 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) }; $emNormalizer = function (Options $options, $em) use ($registry) { + if ($em instanceof ObjectManager) { + return $em; + } + /* @var ManagerRegistry $registry */ if (null !== $em) { return $registry->getManager($em);