[DoctrineBridge] Improve exception message at IdReader::getIdValue()

This commit is contained in:
Javier Spagnoletti 2018-04-22 20:12:04 -03:00
parent 923417122a
commit 5e98478d94

View File

@ -95,10 +95,7 @@ class IdReader
}
if (!$this->om->contains($object)) {
throw new RuntimeException(
'Entities passed to the choice field must be managed. Maybe '.
'persist them in the entity manager?'
);
throw new RuntimeException(sprintf('Entity of type "%s" passed to the choice field must be managed. Maybe you forget to persist it in the entity manager?', get_class($object)));
}
$this->om->initializeObject($object);