ILIAS
trunk Revision v11.0_alpha-1689-g66c127b4ae8
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
DataValidatorService.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\MetaData\Repository\Validation\Data
;
22
23
use
ILIAS\MetaData\Elements\Data\Type
;
24
use
ILIAS\MetaData\DataHelper\DataHelperInterface
;
25
26
class
DataValidatorService
27
{
28
protected
DatetimeValidator
$datetime
;
29
protected
DurationValidator
$duration
;
30
protected
LangValidator
$lang
;
31
protected
NonNegIntValidator
$non_neg_int
;
32
protected
NullValidator
$null
;
33
protected
StringValidator
$string
;
34
protected
VocabSourceValidator
$vocab_source
;
35
protected
VocabValueValidator
$vocab_value
;
36
37
public
function
__construct
(
38
DataHelperInterface
$data_helper
39
) {
40
$this->datetime =
new
DatetimeValidator
($data_helper);
41
$this->duration =
new
DurationValidator
($data_helper);
42
$this->lang =
new
LangValidator
($data_helper);
43
$this->non_neg_int =
new
NonNegIntValidator
();
44
$this->
null
=
new
NullValidator
();
45
$this->
string
=
new
StringValidator
();
46
$this->vocab_source =
new
VocabSourceValidator
();
47
$this->vocab_value =
new
VocabValueValidator
();
48
}
49
50
public
function
validator
(
Type
$type):
DataValidatorInterface
51
{
52
switch
($type) {
53
case
Type::NULL:
54
return
$this->null
;
55
56
case
Type::STRING:
57
return
$this->string
;
58
59
case
Type::LANG:
60
return
$this->lang
;
61
62
case
Type::VOCAB_SOURCE:
63
return
$this->vocab_source
;
64
65
case
Type::VOCAB_VALUE:
66
return
$this->vocab_value
;
67
68
case
Type::DATETIME:
69
return
$this->datetime
;
70
71
case
Type::NON_NEG_INT:
72
return
$this->non_neg_int
;
73
74
case
Type::DURATION
:
75
return
$this->duration
;
76
}
77
throw
new \ilMDRepositoryException(
78
'Unhandled data type when validating.'
79
);
80
}
81
}
ILIAS\MetaData\Repository\Validation\Data\VocabSourceValidator
Definition:
VocabSourceValidator.php:25
ILIAS\MetaData\Elements\Data\DURATION
Definition:
Type.php:32
ILIAS\MetaData\Repository\Validation\Data\NonNegIntValidator
Definition:
NonNegIntValidator.php:25
ILIAS\MetaData\Repository\Validation\Data\DataValidatorService\$lang
LangValidator $lang
Definition:
DataValidatorService.php:30
ILIAS\MetaData\Repository\Validation\Data\DataValidatorService\$string
StringValidator $string
Definition:
DataValidatorService.php:33
ILIAS\MetaData\Repository\Validation\Data\DataValidatorService\__construct
__construct(DataHelperInterface $data_helper)
Definition:
DataValidatorService.php:37
ILIAS\MetaData\Repository\Validation\Data\DataValidatorService\$non_neg_int
NonNegIntValidator $non_neg_int
Definition:
DataValidatorService.php:31
ILIAS\MetaData\Repository\Validation\Data\VocabValueValidator
Definition:
VocabValueValidator.php:25
ILIAS\MetaData\Repository\Validation\Data\DataValidatorService\$duration
DurationValidator $duration
Definition:
DataValidatorService.php:29
DataHelperInterface
ILIAS\MetaData\Repository\Validation\Data\DataValidatorInterface
Definition:
DataValidatorInterface.php:25
ILIAS\MetaData\DataHelper\DataHelperInterface
Definition:
DataHelperInterface.php:23
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:142
ILIAS\MetaData\Repository\Validation\Data\DataValidatorService\$vocab_source
VocabSourceValidator $vocab_source
Definition:
DataValidatorService.php:34
ILIAS\MetaData\Repository\Validation\Data\DataValidatorService\$null
NullValidator $null
Definition:
DataValidatorService.php:32
ILIAS\MetaData\Repository\Validation\Data\DataValidatorService\$datetime
DatetimeValidator $datetime
Definition:
DataValidatorService.php:28
ILIAS\MetaData\Repository\Validation\Data\NullValidator
Definition:
NullValidator.php:25
ILIAS\MetaData\Repository\Validation\Data
Definition:
DataFetcher.php:21
ILIAS\AdvancedMetaData\Data\FieldDefinition\Type
Type
Definition:
Type.php:23
ILIAS\MetaData\Repository\Validation\Data\DurationValidator
Definition:
DurationValidator.php:26
ILIAS\MetaData\Repository\Validation\Data\DataValidatorService
Definition:
DataValidatorService.php:26
ILIAS\MetaData\Repository\Validation\Data\LangValidator
Definition:
LangValidator.php:26
ILIAS\MetaData\Elements\Data\Type
Type
Definition:
Type.php:23
ILIAS\MetaData\Repository\Validation\Data\DataValidatorService\validator
validator(Type $type)
Definition:
DataValidatorService.php:50
ILIAS\MetaData\Repository\Validation\Data\DatetimeValidator
Definition:
DatetimeValidator.php:26
ILIAS\MetaData\Repository\Validation\Data\StringValidator
Definition:
StringValidator.php:25
ILIAS\MetaData\Repository\Validation\Data\DataValidatorService\$vocab_value
VocabValueValidator $vocab_value
Definition:
DataValidatorService.php:35
components
ILIAS
MetaData
classes
Repository
Validation
Data
DataValidatorService.php
Generated on Wed Apr 2 2025 23:03:16 for ILIAS by
1.8.13 (using
Doxyfile
)