protected function isValid($object)
{
$messages = new ErrorResult();
foreach ($this->propertyValidators as $propertyName => $validators) {
$propertyValue = $this->getPropertyValue($object, $propertyName);
$result = $this->checkProperty($propertyValue, $validators);
if ($result !== null) {
$messages->forProperty($propertyName)->merge($result);
}
}
$this->result = $messages;
}