ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilDclInputException Class Reference

Class ilDclBaseFieldModel. More...

+ Inheritance diagram for ilDclInputException:
+ Collaboration diagram for ilDclInputException:

Public Member Functions

 __construct ($exception_type, $additional_text="")
 
 getExceptionType ()
 
 __toString ()
 
 __construct ($a_message, $a_code=0)
 A message isn't optional as in build in class Exception. More...
 

Data Fields

const TYPE_EXCEPTION = 0
 
const LENGTH_EXCEPTION = 1
 
const REGEX_EXCEPTION = 2
 
const UNIQUE_EXCEPTION = 3
 
const NOT_URL = 4
 
const NOT_IMAGE = 5
 
const WRONG_FILE_TYPE = 6
 
const CUSTOM_MESSAGE = 7
 
const REGEX_CONFIG_EXCEPTION = 8
 

Protected Attributes

 $exception_type
 
 $additional_text
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDclInputException::__construct (   $exception_type,
  $additional_text = "" 
)
Parameters
string$exception_type

Reimplemented from ilException.

Definition at line 44 of file class.ilDclInputException.php.

44 {
45 parent::__construct($exception_type);
46 $this->exception_type = $exception_type;
47 $this->additional_text = $additional_text;
48 }

References $additional_text, and $exception_type.

Member Function Documentation

◆ __toString()

ilDclInputException::__toString ( )
Returns
string

Definition at line 62 of file class.ilDclInputException.php.

62 {
63 global $DIC;
64 $lng = $DIC['lng'];
65
66 switch ($this->exception_type) {
68 $message = $lng->txt('dcl_wrong_input_type');
69 break;
71 $message = $lng->txt('dcl_wrong_length');
72 break;
74 $message = $lng->txt('dcl_wrong_regex');
75 break;
77 $message = $lng->txt('dcl_invalid_regex_config');
78 break;
80 $message = $lng->txt('dcl_unique_exception');
81 break;
82 case self::NOT_URL:
83 $message = $lng->txt('dcl_noturl_exception');
84 break;
85 case self::NOT_IMAGE:
86 $message = $lng->txt('dcl_notimage_exception');
87 break;
89 $message = $lng->txt('dcl_not_supported_file_type');
90 break;
93 break;
94 default:
95 $message = $lng->txt('dcl_unknown_exception');
96 }
97
98 if(strlen($this->additional_text) > 0) {
99 $message .= " ".$this->additional_text;
100 }
101
102 return $message;
103 }
global $lng
Definition: privfeed.php:17
global $DIC

References $additional_text, $DIC, $lng, CUSTOM_MESSAGE, LENGTH_EXCEPTION, NOT_IMAGE, NOT_URL, REGEX_CONFIG_EXCEPTION, REGEX_EXCEPTION, TYPE_EXCEPTION, UNIQUE_EXCEPTION, and WRONG_FILE_TYPE.

◆ getExceptionType()

ilDclInputException::getExceptionType ( )
Returns
string

Definition at line 54 of file class.ilDclInputException.php.

54 {
56 }

References $exception_type.

Field Documentation

◆ $additional_text

ilDclInputException::$additional_text
protected

Definition at line 38 of file class.ilDclInputException.php.

Referenced by __construct(), and __toString().

◆ $exception_type

ilDclInputException::$exception_type
protected

Definition at line 33 of file class.ilDclInputException.php.

Referenced by __construct(), and getExceptionType().

◆ CUSTOM_MESSAGE

const ilDclInputException::CUSTOM_MESSAGE = 7

Definition at line 26 of file class.ilDclInputException.php.

Referenced by __toString().

◆ LENGTH_EXCEPTION

const ilDclInputException::LENGTH_EXCEPTION = 1

◆ NOT_IMAGE

const ilDclInputException::NOT_IMAGE = 5

Definition at line 24 of file class.ilDclInputException.php.

Referenced by __toString().

◆ NOT_URL

const ilDclInputException::NOT_URL = 4

◆ REGEX_CONFIG_EXCEPTION

const ilDclInputException::REGEX_CONFIG_EXCEPTION = 8

◆ REGEX_EXCEPTION

const ilDclInputException::REGEX_EXCEPTION = 2

◆ TYPE_EXCEPTION

const ilDclInputException::TYPE_EXCEPTION = 0

◆ UNIQUE_EXCEPTION

◆ WRONG_FILE_TYPE

const ilDclInputException::WRONG_FILE_TYPE = 6

Definition at line 25 of file class.ilDclInputException.php.

Referenced by __toString().


The documentation for this class was generated from the following file: