ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
ilDclInputException.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
class
ilDclInputException
extends
ilException
22
{
23
public
const
TYPE_EXCEPTION
= 0;
24
public
const
LENGTH_EXCEPTION
= 1;
25
public
const
REGEX_EXCEPTION
= 2;
26
public
const
UNIQUE_EXCEPTION
= 3;
27
public
const
NOT_URL
= 4;
28
public
const
NOT_IMAGE
= 5;
29
public
const
WRONG_FILE_TYPE
= 6;
30
public
const
CUSTOM_MESSAGE
= 7;
31
public
const
REGEX_CONFIG_EXCEPTION
= 8;
32
protected
ilLanguage
$lng
;
33
34
protected
int
$exception_type
;
35
protected
string
$additional_text
;
36
40
public
function
__construct
(
int
$exception_type
,
$additional_text
=
""
)
41
{
42
global
$DIC
;
43
$this->
lng
= $DIC->language();
44
45
$this->exception_type =
$exception_type
;
46
$this->additional_text =
$additional_text
;
47
parent::__construct
($this->
__toString
(), $exception_type);
48
}
49
50
public
function
getExceptionType
():
int
51
{
52
return
$this->exception_type
;
53
}
54
55
public
function
__toString
(): string
56
{
57
switch
($this->exception_type) {
58
case
self::TYPE_EXCEPTION
:
59
$message
= $this->
lng
->txt(
'dcl_wrong_input_type'
);
60
break
;
61
case
self::LENGTH_EXCEPTION
:
62
$message
= $this->
lng
->txt(
'dcl_wrong_length'
);
63
break
;
64
case
self::REGEX_EXCEPTION
:
65
$message
= $this->
lng
->txt(
'dcl_wrong_regex'
);
66
break
;
67
case
self::REGEX_CONFIG_EXCEPTION
:
68
$message
= $this->
lng
->txt(
'dcl_invalid_regex_config'
);
69
break
;
70
case
self::UNIQUE_EXCEPTION
:
71
$message
= $this->
lng
->txt(
'dcl_unique_exception'
);
72
break
;
73
case
self::NOT_URL
:
74
$message
= $this->
lng
->txt(
'dcl_noturl_exception'
);
75
break
;
76
case
self::NOT_IMAGE
:
77
$message
= $this->
lng
->txt(
'dcl_notimage_exception'
);
78
break
;
79
case
self::WRONG_FILE_TYPE
:
80
$message
= $this->
lng
->txt(
'dcl_not_supported_file_type'
);
81
break
;
82
case
self::CUSTOM_MESSAGE
:
83
return
$this->additional_text
;
84
default
:
85
$message
= $this->
lng
->txt(
'dcl_unknown_exception'
);
86
}
87
88
if
(strlen($this->additional_text) > 0) {
89
$message
.=
" "
.
$this->additional_text
;
90
}
91
92
return
$message
;
93
}
94
}
ilDclInputException
Definition:
ilDclInputException.php:22
ilDclInputException\$additional_text
string $additional_text
Definition:
ilDclInputException.php:35
ilDclInputException\REGEX_CONFIG_EXCEPTION
const REGEX_CONFIG_EXCEPTION
Definition:
ilDclInputException.php:31
ilDclInputException\getExceptionType
getExceptionType()
Definition:
ilDclInputException.php:50
ilDclInputException\REGEX_EXCEPTION
const REGEX_EXCEPTION
Definition:
ilDclInputException.php:25
ilDclInputException\__toString
__toString()
Definition:
ilDclInputException.php:55
ilDclInputException\$lng
ilLanguage $lng
Definition:
ilDclInputException.php:32
ilDclInputException\__construct
__construct(int $exception_type, $additional_text="")
Definition:
ilDclInputException.php:40
ilDclInputException\UNIQUE_EXCEPTION
const UNIQUE_EXCEPTION
Definition:
ilDclInputException.php:26
ilDclInputException\LENGTH_EXCEPTION
const LENGTH_EXCEPTION
Definition:
ilDclInputException.php:24
ilDclInputException\$exception_type
int $exception_type
Definition:
ilDclInputException.php:34
ilDclInputException\CUSTOM_MESSAGE
const CUSTOM_MESSAGE
Definition:
ilDclInputException.php:30
ilDclInputException\TYPE_EXCEPTION
const TYPE_EXCEPTION
Definition:
ilDclInputException.php:23
ilDclInputException\NOT_IMAGE
const NOT_IMAGE
Definition:
ilDclInputException.php:28
ilDclInputException\NOT_URL
const NOT_URL
Definition:
ilDclInputException.php:27
ilDclInputException\WRONG_FILE_TYPE
const WRONG_FILE_TYPE
Definition:
ilDclInputException.php:29
ilException
Base class for ILIAS Exception handling.
Definition:
class.ilException.php:26
ilLanguage
language handling
Definition:
class.ilLanguage.php:43
ILIAS\GlobalScreen\Provider\__construct
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Definition:
PluginProviderHelper.php:38
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
ILIAS\Repository\lng
lng()
Definition:
trait.GlobalDICDomainServices.php:61
$DIC
global $DIC
Definition:
shib_login.php:26
$message
$message
Definition:
xapiexit.php:31
components
ILIAS
DataCollection
exceptions
ilDclInputException.php
Generated on Sat Oct 18 2025 23:02:57 for ILIAS by
1.9.4 (using
Doxyfile
)