Permalink
Browse files

fix unqiue validator when checked column is the first of all class fi…

…elds
  • Loading branch information...
1 parent 32423b0 commit 995d655a6d1539b8188ebdaaf9e5d560f13bf7e0 @docteurklein docteurklein committed Dec 22, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 Validator/Constraints/UniqueObjectValidator.php
View
2 Validator/Constraints/UniqueObjectValidator.php
@@ -45,7 +45,7 @@ public function isValid($object, Constraint $constraint)
$classFields = $peerClass::getFieldNames(\BasePeer::TYPE_FIELDNAME);
foreach ($fields as $fieldName) {
- if(!array_search($fieldName, $classFields)) {
+ if(false === array_search($fieldName, $classFields)) {
throw new ConstraintDefinitionException('The field "' . $fieldName .'" doesn\'t exist in the "' . $class . '" class.');
}
}

0 comments on commit 995d655

Please sign in to comment.