Skip to content

Commit a84e229

Browse files
committed
fix UniqueObjectValidator to be compatible with sf 3.x
1 parent 6a6ff6d commit a84e229

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

Validator/Constraints/UniqueObjectValidator.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,13 @@ public function validate($object, Constraint $constraint)
6060
);
6161
}
6262

63-
$this->context->addViolationAt(
64-
$constraint->errorPath,
65-
$constraint->message,
66-
array(
63+
$this->context->buildViolation($constraint->message)
64+
->atPath($constraint->errorPath)
65+
->setParameters(array(
6766
'{{ object_class }}' => $class,
6867
'{{ fields }}' => implode($constraint->messageFieldSeparator, $fieldParts)
69-
)
70-
);
71-
68+
))
69+
->addViolation();
7270
}
7371
}
7472
}

0 commit comments

Comments
 (0)