ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilDclInputException Class Reference

Class ilDclBaseFieldModel. More...

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

Public Member Functions

 __construct ($exception_type, $additional_text="")
 
 getExceptionType ()
 
 __toString ()
 
- Public Member Functions inherited from ilException
 __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

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

References $additional_text, and $exception_type.

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

Member Function Documentation

◆ __toString()

ilDclInputException::__toString ( )
Returns
string

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

References $additional_text, $DIC, $lng, and $message.

65  {
66  global $DIC;
67  $lng = $DIC['lng'];
68 
69  switch ($this->exception_type) {
70  case self::TYPE_EXCEPTION:
71  $message = $lng->txt('dcl_wrong_input_type');
72  break;
73  case self::LENGTH_EXCEPTION:
74  $message = $lng->txt('dcl_wrong_length');
75  break;
76  case self::REGEX_EXCEPTION:
77  $message = $lng->txt('dcl_wrong_regex');
78  break;
79  case self::REGEX_CONFIG_EXCEPTION:
80  $message = $lng->txt('dcl_invalid_regex_config');
81  break;
82  case self::UNIQUE_EXCEPTION:
83  $message = $lng->txt('dcl_unique_exception');
84  break;
85  case self::NOT_URL:
86  $message = $lng->txt('dcl_noturl_exception');
87  break;
88  case self::NOT_IMAGE:
89  $message = $lng->txt('dcl_notimage_exception');
90  break;
91  case self::WRONG_FILE_TYPE:
92  $message = $lng->txt('dcl_not_supported_file_type');
93  break;
94  case self::CUSTOM_MESSAGE:
96  break;
97  default:
98  $message = $lng->txt('dcl_unknown_exception');
99  }
100 
101  if (strlen($this->additional_text) > 0) {
103  }
104 
105  return $message;
106  }
global $DIC
Definition: saml.php:7
catch(Exception $e) $message
global $lng
Definition: privfeed.php:17

◆ getExceptionType()

ilDclInputException::getExceptionType ( )
Returns
string

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

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.

◆ LENGTH_EXCEPTION

const ilDclInputException::LENGTH_EXCEPTION = 1

◆ NOT_IMAGE

const ilDclInputException::NOT_IMAGE = 5

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

◆ 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

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

Referenced by ilDclNumberFieldModel\checkValidity().

◆ UNIQUE_EXCEPTION

◆ WRONG_FILE_TYPE

const ilDclInputException::WRONG_FILE_TYPE = 6

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


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