Merge pull request #92 from docteurklein/fix_unique
fix unique validator when checked column is the first of all class fields
This commit is contained in:
commit
22e79ef973
|
@ -45,7 +45,7 @@ class UniqueObjectValidator extends ConstraintValidator
|
||||||
$classFields = $peerClass::getFieldNames(\BasePeer::TYPE_FIELDNAME);
|
$classFields = $peerClass::getFieldNames(\BasePeer::TYPE_FIELDNAME);
|
||||||
|
|
||||||
foreach ($fields as $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.');
|
throw new ConstraintDefinitionException('The field "' . $fieldName .'" doesn\'t exist in the "' . $class . '" class.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue