[DoctrineBridge] Iterator->current() is not the same as current(Iterator)
This commit is contained in:
parent
4bb65c7057
commit
c8e74da8be
@ -106,7 +106,7 @@ class UniqueEntityValidator extends ConstraintValidator
|
||||
* which is the same as the entity being validated, the criteria is
|
||||
* unique.
|
||||
*/
|
||||
if (0 === count($result) || (1 === count($result) && $entity === current($result))) {
|
||||
if (0 === count($result) || (1 === count($result) && $entity === ($result instanceof \Iterator ? $result->current() : current($result)))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user