merged branch mvrhov/patch-2 (PR #5857)
This PR was merged into the 2.0 branch.
Commits
-------
6b42c8c
The exception message should say which field is not mapped
Discussion
----------
The exception message should tell which field is not mapped
This commit is contained in:
commit
a09319df75
@ -63,7 +63,7 @@ class UniqueEntityValidator extends ConstraintValidator
|
|||||||
$criteria = array();
|
$criteria = array();
|
||||||
foreach ($fields as $fieldName) {
|
foreach ($fields as $fieldName) {
|
||||||
if (!isset($class->reflFields[$fieldName])) {
|
if (!isset($class->reflFields[$fieldName])) {
|
||||||
throw new ConstraintDefinitionException('Only field names mapped by Doctrine can be validated for uniqueness.');
|
throw new ConstraintDefinitionException(sprintf("The field '%s' is not mapped by Doctrine, so it cannot be validated for uniqueness.", $fieldName));
|
||||||
}
|
}
|
||||||
|
|
||||||
$criteria[$fieldName] = $class->reflFields[$fieldName]->getValue($entity);
|
$criteria[$fieldName] = $class->reflFields[$fieldName]->getValue($entity);
|
||||||
|
Reference in New Issue
Block a user