<?php
namespace gnomephp\input;
class UploadFieldValidException extends \Exception{
/**
* Array of error strings.
* @var array
*/
private $errors = array();
/**
*
* Throws Exception.
* @param array $errors Array of strings containg the error messages.
* @param string $message
* @param int $code
* @param bool $previous
*/
public function __construct($errors,$message=null, $code=null, $previous=null){
$this->errors = $errors;
parent::__construct(($message !== null ? implode(', ', $errors) : $message), $code, $previous);
}
/**
*
* @return array Array of string messages, the messages depends on what validaiton rule that failed.
*/
public function getErrors(){
return $this->errors;
}
}