merged branch jmikola/patch-4 (PR #3540)
Commits
-------
c8e74da
[DoctrineBridge] Iterator->current() is not the same as current(Iterator)
Discussion
----------
[DoctrineBridge] Iterator->current() is not the same as current(Iterator)
More lively discussion from: doctrine/DoctrineMongoDBBundle#84.
This commit is contained in:
commit
1a2642a85a
@ -106,7 +106,7 @@ class UniqueEntityValidator extends ConstraintValidator
|
|||||||
* which is the same as the entity being validated, the criteria is
|
* which is the same as the entity being validated, the criteria is
|
||||||
* unique.
|
* 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user