openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

ValidationException.class.php (650B)


      1 <?php
      2 
      3 namespace util\exception;
      4 use Exception;
      5 
      6 class ValidationException extends UIException
      7 {
      8 	public $fieldName;
      9 
     10 	// Die Exception neu definieren, damit die Mitteilung nicht optional ist
     11 	public function __construct($fieldName,$key='COMMON_VALIDATION_ERROR',$params = [] )
     12 	{
     13 		$this->fieldName = $fieldName;
     14 
     15 		// sicherstellen, dass alles korrekt zugewiesen wird
     16 		parent::__construct($key, '', $params );
     17 	}
     18 
     19 	// maßgeschneiderte Stringdarstellung des Objektes
     20 	public function __toString()
     21 	{
     22 		return __CLASS__ . ": " . $this->fieldName . ": '{$this->message}' in {$this->file}({$this->line})\n"
     23 			. "{$this->getTraceAsString()}\n";
     24 	}
     25 
     26 }