[DoctrineBridge] Improved exception message

This commit is contained in:
Bernhard Schussek 2012-12-06 11:27:06 +01:00
parent 99321cbe24
commit db2ee54bda

View File

@ -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);