ILIAS
release_8 Revision v8.24
◀ ilDoc Overview
class.ilDclInputException.php
Go to the documentation of this file.
1
<?php
2
19
class
ilDclInputException
extends
ilException
20
{
21
public
const
TYPE_EXCEPTION
= 0;
22
public
const
LENGTH_EXCEPTION
= 1;
23
public
const
REGEX_EXCEPTION
= 2;
24
public
const
UNIQUE_EXCEPTION
= 3;
25
public
const
NOT_URL
= 4;
26
public
const
NOT_IMAGE
= 5;
27
public
const
WRONG_FILE_TYPE
= 6;
28
public
const
CUSTOM_MESSAGE
= 7;
29
public
const
REGEX_CONFIG_EXCEPTION
= 8;
30
31
protected
string
$exception_type
;
32
protected
string
$additional_text
;
33
37
public
function
__construct
(
$exception_type
,
$additional_text
=
""
)
38
{
39
$this->exception_type =
$exception_type
;
40
$this->additional_text =
$additional_text
;
41
parent::__construct
($this->
__toString
(), $exception_type);
42
}
43
44
public
function
getExceptionType
(): string
45
{
46
return
$this->exception_type
;
47
}
48
49
public
function
__toString
(): string
50
{
51
global
$DIC
;
52
$lng
=
$DIC
[
'lng'
];
53
54
switch
($this->exception_type) {
55
case
self::TYPE_EXCEPTION
:
56
$message
=
$lng
->txt(
'dcl_wrong_input_type'
);
57
break
;
58
case
self::LENGTH_EXCEPTION
:
59
$message
=
$lng
->txt(
'dcl_wrong_length'
);
60
break
;
61
case
self::REGEX_EXCEPTION
:
62
$message
=
$lng
->txt(
'dcl_wrong_regex'
);
63
break
;
64
case
self::REGEX_CONFIG_EXCEPTION
:
65
$message
=
$lng
->txt(
'dcl_invalid_regex_config'
);
66
break
;
67
case
self::UNIQUE_EXCEPTION
:
68
$message
=
$lng
->txt(
'dcl_unique_exception'
);
69
break
;
70
case
self::NOT_URL
:
71
$message
=
$lng
->txt(
'dcl_noturl_exception'
);
72
break
;
73
case
self::NOT_IMAGE
:
74
$message
=
$lng
->txt(
'dcl_notimage_exception'
);
75
break
;
76
case
self::WRONG_FILE_TYPE
:
77
$message
=
$lng
->txt(
'dcl_not_supported_file_type'
);
78
break
;
79
case
self::CUSTOM_MESSAGE
:
80
return
$this->additional_text
;
81
break
;
82
default
:
83
$message
=
$lng
->txt(
'dcl_unknown_exception'
);
84
}
85
86
if
(strlen($this->additional_text) > 0) {
87
$message
.=
" "
.
$this->additional_text
;
88
}
89
90
return
$message
;
91
}
92
}
ilDclInputException
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilDclInputException.php:20
ilDclInputException\$additional_text
string $additional_text
Definition:
class.ilDclInputException.php:32
ilDclInputException\REGEX_CONFIG_EXCEPTION
const REGEX_CONFIG_EXCEPTION
Definition:
class.ilDclInputException.php:29
ilDclInputException\getExceptionType
getExceptionType()
Definition:
class.ilDclInputException.php:44
ilDclInputException\__construct
__construct($exception_type, $additional_text="")
Definition:
class.ilDclInputException.php:37
ilDclInputException\$exception_type
string $exception_type
Definition:
class.ilDclInputException.php:31
ilDclInputException\REGEX_EXCEPTION
const REGEX_EXCEPTION
Definition:
class.ilDclInputException.php:23
ilDclInputException\__toString
__toString()
Definition:
class.ilDclInputException.php:49
ilDclInputException\UNIQUE_EXCEPTION
const UNIQUE_EXCEPTION
Definition:
class.ilDclInputException.php:24
ilDclInputException\LENGTH_EXCEPTION
const LENGTH_EXCEPTION
Definition:
class.ilDclInputException.php:22
ilDclInputException\CUSTOM_MESSAGE
const CUSTOM_MESSAGE
Definition:
class.ilDclInputException.php:28
ilDclInputException\TYPE_EXCEPTION
const TYPE_EXCEPTION
Definition:
class.ilDclInputException.php:21
ilDclInputException\NOT_IMAGE
const NOT_IMAGE
Definition:
class.ilDclInputException.php:26
ilDclInputException\NOT_URL
const NOT_URL
Definition:
class.ilDclInputException.php:25
ilDclInputException\WRONG_FILE_TYPE
const WRONG_FILE_TYPE
Definition:
class.ilDclInputException.php:27
ilException
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilException.php:26
$DIC
global $DIC
Definition:
feed.php:28
ILIAS\GlobalScreen\Provider\__construct
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Definition:
PluginProviderHelper.php:37
$lng
$lng
Definition:
save_question_post_data.php:24
$message
$message
Definition:
xapiexit.php:32
Modules
DataCollection
exceptions
class.ilDclInputException.php
Generated on Sun Nov 2 2025 22:01:08 for ILIAS by
1.9.4 (using
Doxyfile
)