1
0
mirror of synced 2025-01-29 19:41:45 +03:00

fixed default error message for ValidatorException that list the classes that have validation errors

This commit is contained in:
meus 2007-07-21 22:15:22 +00:00
parent f04948f315
commit 2d55394109

View File

@ -42,6 +42,7 @@ class Doctrine_Validator_Exception extends Doctrine_Exception implements Countab
public function __construct(array $invalid)
{
$this->invalid = $invalid;
parent::__construct($this->generateMessage());
}
public function getInvalidRecords()
@ -68,4 +69,14 @@ class Doctrine_Validator_Exception extends Doctrine_Exception implements Countab
return parent::__toString();
}
private function generateMessage()
{
$message = "";
foreach ($this->invalid as $record){
$message .= "Validaton error in class " . get_class($record) . " ";
}
return $message;
}
}