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
class.ilADTText.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
class
ilADTText
extends
ilADT
22
{
23
protected
?
string
$value
;
24
25
// definition
26
27
protected
function
isValidDefinition
(
ilADTDefinition
$a_def): bool
28
{
29
return
$a_def instanceof
ilADTTextDefinition
;
30
}
31
32
public
function
reset
(): void
33
{
34
parent::reset();
35
$this->value =
null
;
36
}
37
38
// properties
39
40
public
function
setText
(?
string
$a_value =
null
): void
41
{
42
if
($a_value !==
null
) {
43
$a_value = trim($a_value);
44
}
45
$this->value = $a_value;
46
}
47
48
public
function
getText
(): ?string
49
{
50
return
$this->value
;
51
}
52
53
public
function
getLength
():
int
54
{
55
if
(function_exists(
"mb_strlen"
)) {
56
return
mb_strlen((
string
) $this->
getText
(),
"UTF-8"
);
57
}
else
{
58
return
strlen((
string
) $this->
getText
());
59
}
60
}
61
62
// comparison
63
64
public
function
equals
(
ilADT
$a_adt): ?bool
65
{
66
if
($this->
getDefinition
()->isComparableTo($a_adt)) {
67
return
!strcmp($this->
getText
(), $a_adt->getText());
68
}
69
return
null
;
70
}
71
72
public
function
isLarger
(
ilADT
$a_adt): ?bool
73
{
74
return
null
;
75
}
76
77
public
function
isSmaller
(
ilADT
$a_adt): ?bool
78
{
79
return
null
;
80
}
81
82
// null
83
84
public
function
isNull
(): bool
85
{
86
return
!$this->
getLength
();
87
}
88
89
// validation
90
91
public
function
isValid
(): bool
92
{
93
$valid
= parent::isValid();
94
if
(!$this->
isNull
()) {
95
$max = $this->
getDefinition
()->getMaxLength();
96
if
($max && $max < $this->
getLength
()) {
97
$valid
=
false
;
98
$this->
addValidationError
(self::ADT_VALIDATION_ERROR_MAX_LENGTH);
99
}
100
}
101
return
$valid
;
102
}
103
104
public
function
getCheckSum
(): ?string
105
{
106
if
(!$this->
isNull
()) {
107
return
md5($this->
getText
());
108
}
109
return
null
;
110
}
111
112
public
function
exportStdClass
(): ?
stdClass
113
{
114
if
(!$this->
isNull
()) {
115
$obj =
new
stdClass
();
116
$obj->value = $this->
getText
();
117
return
$obj;
118
}
119
return
null
;
120
}
121
122
public
function
importStdClass
(?
stdClass
$a_std): void
123
{
124
if
(is_object($a_std)) {
125
$this->
setText
($a_std->value);
126
}
127
}
128
}
ilADTTextDefinition
Definition:
class.ilADTTextDefinition.php:21
ilADTText\equals
equals(ilADT $a_adt)
Definition:
class.ilADTText.php:64
ilADT\addValidationError
addValidationError(string $a_error_code)
Definition:
class.ilADT.php:237
ilADTText\isNull
isNull()
Definition:
class.ilADTText.php:84
ilADTText\$value
string $value
Definition:
class.ilADTText.php:23
stdClass
$valid
$valid
Definition:
dummy_client.php:59
ilADT
ADT base class.
Definition:
class.ilADT.php:25
ilADTText\isSmaller
isSmaller(ilADT $a_adt)
Definition:
class.ilADTText.php:77
ilADTText\setText
setText(?string $a_value=null)
Definition:
class.ilADTText.php:40
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:142
ilADTText\isValidDefinition
isValidDefinition(ilADTDefinition $a_def)
Definition:
class.ilADTText.php:27
ilADTText\importStdClass
importStdClass(?stdClass $a_std)
Definition:
class.ilADTText.php:122
ilADTText\getCheckSum
getCheckSum()
Definition:
class.ilADTText.php:104
ilADTText\getText
getText()
Definition:
class.ilADTText.php:48
ilADTText\exportStdClass
exportStdClass()
Definition:
class.ilADTText.php:112
ilADTText\isValid
isValid()
Definition:
class.ilADTText.php:91
ilADTText\reset
reset()
Definition:
class.ilADTText.php:32
ilADTText\isLarger
isLarger(ilADT $a_adt)
Definition:
class.ilADTText.php:72
ilADTText
Definition:
class.ilADTText.php:21
ilADTDefinition
ADT definition base class.
Definition:
class.ilADTDefinition.php:25
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
ilADTText\getLength
getLength()
Definition:
class.ilADTText.php:53
ilADT\getDefinition
getDefinition()
Get definition.
Definition:
class.ilADT.php:106
components
ILIAS
ADT
classes
Types
Text
class.ilADTText.php
Generated on Wed Apr 2 2025 23:01:48 for ILIAS by
1.8.13 (using
Doxyfile
)