ILIAS
trunk Revision v11.0_alpha-1715-g7fc467680fb
◀ 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
Collection.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
namespace
ILIAS\GlobalScreen\ScreenContext\AdditionalData
;
21
22
use
LogicException
;
23
28
class
Collection
29
{
30
private
array
$values
= [];
31
35
public
function
getData
(): array
36
{
37
return
$this->values
;
38
}
39
44
public
function
add
(
string
$key, $value): void
45
{
46
if
($this->
exists
($key)) {
47
throw
new
LogicException
(
"Key $key already exists."
);
48
}
49
$this->values[$key] = $value;
50
}
51
56
public
function
get
(
string
$key)
57
{
58
return
$this->values[$key];
59
}
60
66
public
function
is
(
string
$key, $expected_value): bool
67
{
68
return
($this->
exists
($key) && $this->
get
($key) === $expected_value);
69
}
70
75
public
function
exists
(
string
$key): bool
76
{
77
return
isset($this->values[$key]);
78
}
79
84
public
function
replace
(
string
$key, $value): void
85
{
86
if
(!$this->
exists
($key)) {
87
throw
new
LogicException
(
"Key $key does not exists."
);
88
}
89
$this->values[$key] = $value;
90
}
91
}
LogicException
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\add
add(string $key, $value)
Definition:
Collection.php:44
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\is
is(string $key, $expected_value)
Definition:
Collection.php:66
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\exists
exists(string $key)
Definition:
Collection.php:75
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection
Class Collection.
Definition:
Collection.php:28
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\$values
array $values
Definition:
Collection.php:30
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\replace
replace(string $key, $value)
Definition:
Collection.php:84
ILIAS\GlobalScreen\ScreenContext\AdditionalData
Definition:
Collection.php:20
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\getData
getData()
Definition:
Collection.php:35
components
ILIAS
GlobalScreen
src
ScreenContext
AdditionalData
Collection.php
Generated on Sat Apr 5 2025 23:02:23 for ILIAS by
1.8.13 (using
Doxyfile
)