2006-05-30 12:56:40 +04:00
|
|
|
<?php
|
2006-05-30 13:12:57 +04:00
|
|
|
Doctrine::autoload('Doctrine_Exception');
|
2006-05-30 12:56:40 +04:00
|
|
|
|
|
|
|
class Doctrine_Validator_Exception extends Doctrine_Exception {
|
2006-06-08 14:20:30 +04:00
|
|
|
/**
|
|
|
|
* @var Doctrine_Validator $validator
|
|
|
|
*/
|
2006-05-30 12:56:40 +04:00
|
|
|
private $validator;
|
2006-06-08 14:20:30 +04:00
|
|
|
/**
|
|
|
|
* @param Doctrine_Validator $validator
|
|
|
|
*/
|
2006-05-30 12:56:40 +04:00
|
|
|
public function __construct(Doctrine_Validator $validator) {
|
|
|
|
$this->validator = $validator;
|
|
|
|
}
|
2006-06-08 14:20:30 +04:00
|
|
|
/**
|
|
|
|
* returns the error stack
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2006-05-30 12:56:40 +04:00
|
|
|
public function getErrorStack() {
|
|
|
|
return $this->validator->getErrorStack();
|
|
|
|
}
|
2006-06-08 14:20:30 +04:00
|
|
|
/**
|
|
|
|
* __toString
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function __toString() {
|
|
|
|
$string = "Error stack : ".print_r($this->validator->getErrorStack(), true);
|
|
|
|
return $string.parent::__toString();
|
|
|
|
}
|
2006-05-30 12:56:40 +04:00
|
|
|
}
|
2006-09-04 02:46:30 +04:00
|
|
|
|