From db2ee54bdad6103359bfd8a00cde28abe3d3332f Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Thu, 6 Dec 2012 11:27:06 +0100 Subject: [PATCH] [DoctrineBridge] Improved exception message --- .../Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php index 78594ed8ba..2e385a343f 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php @@ -392,7 +392,10 @@ class EntityChoiceList extends ObjectChoiceList private function getIdentifierValues($entity) { if (!$this->em->contains($entity)) { - throw new FormException('Entities passed to the choice field must be managed'); + throw new FormException( + 'Entities passed to the choice field must be managed. Maybe ' . + 'persist them in the entity manager?' + ); } $this->em->initializeObject($entity);