1
0
Fork 0
mirror of synced 2025-04-03 13:23:37 +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) public function __construct(array $invalid)
{ {
$this->invalid = $invalid; $this->invalid = $invalid;
parent::__construct($this->generateMessage());
} }
public function getInvalidRecords() public function getInvalidRecords()
@ -68,4 +69,14 @@ class Doctrine_Validator_Exception extends Doctrine_Exception implements Countab
return parent::__toString(); return parent::__toString();
} }
private function generateMessage()
{
$message = "";
foreach ($this->invalid as $record){
$message .= "Validaton error in class " . get_class($record) . " ";
}
return $message;
}
} }