fix unqiue validator when checked column is the first of all class fields
This commit is contained in:
parent
32423b077e
commit
995d655a6d
|
@ -45,7 +45,7 @@ class UniqueObjectValidator extends ConstraintValidator
|
|||
$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.');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue