Skip to content

Commit

Permalink
Merge pull request #92 from docteurklein/fix_unique
Browse files Browse the repository at this point in the history
fix unique validator when checked column is the first of all class fields
  • Loading branch information
willdurand committed Dec 23, 2011
2 parents 32423b0 + 995d655 commit 22e79ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Validator/Constraints/UniqueObjectValidator.php
Expand Up @@ -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.');
}
}
Expand Down

0 comments on commit 22e79ef

Please sign in to comment.