class FileValidationException in Drupal 10
Provides an exception for upload validation errors.
Hierarchy
- class \Drupal\file\Upload\FileValidationException extends \Drupal\file\Upload\RuntimeException
Expanded class hierarchy of FileValidationException
1 file declares its use of FileValidationException
- file.module in core/
modules/ file/ file.module - Defines a "managed_file" Form API field and a "file" field for Field module.
File
- core/
modules/ file/ src/ Upload/ FileValidationException.php, line 8
Namespace
Drupal\file\UploadView source
class FileValidationException extends \RuntimeException {
/**
* The validation errors.
*
* @var array
*/
protected $errors;
/**
* The file name.
*
* @var string
*/
protected $fileName;
/**
* Constructs a new FileValidationException.
*
* @param string $message
* The message.
* @param string $file_name
* The file name.
* @param array $errors
* The validation errors.
*/
public function __construct(string $message, string $file_name, array $errors) {
parent::__construct($message, 0, NULL);
$this->fileName = $file_name;
$this->errors = $errors;
}
/**
* Gets the file name.
*
* @return string
* The file name.
*/
public function getFilename() : string {
return $this->fileName;
}
/**
* Gets the errors.
*
* @return array
* The errors.
*/
public function getErrors() : array {
return $this->errors;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FileValidationException:: |
protected | property | The validation errors. | |
FileValidationException:: |
protected | property | The file name. | |
FileValidationException:: |
public | function | Gets the errors. | |
FileValidationException:: |
public | function | Gets the file name. | |
FileValidationException:: |
public | function | Constructs a new FileValidationException. |