ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
r
s
t
w
+
Functions
_
a
b
c
f
g
h
i
r
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
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
+
Files
File List
+
Globals
+
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
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
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
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
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
{
33
private
$values
= [];
34
38
public
function
getData
() : array
39
{
40
return
$this->values
;
41
}
42
47
public
function
add
(
string
$key, $value) : void
48
{
49
if
($this->
exists
($key)) {
50
throw
new
LogicException
(
"Key $key already exists."
);
51
}
52
$this->values[$key] = $value;
53
}
54
59
public
function
get
(
string
$key)
60
{
61
return
$this->values[$key];
62
}
63
69
public
function
is
(
string
$key, $expected_value) : bool
70
{
71
return
($this->
exists
($key) && $this->
get
($key) === $expected_value);
72
}
73
78
public
function
exists
(
string
$key) : bool
79
{
80
return
isset($this->values[$key]);
81
}
82
87
public
function
replace
(
string
$key, $value) : void
88
{
89
if
(!$this->
exists
($key)) {
90
throw
new
LogicException
(
"Key $key does not exists."
);
91
}
92
$this->values[$key] = $value;
93
}
94
}
LogicException
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\add
add(string $key, $value)
Definition:
Collection.php:47
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\$values
$values
Definition:
Collection.php:33
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\is
is(string $key, $expected_value)
Definition:
Collection.php:69
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\exists
exists(string $key)
Definition:
Collection.php:78
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection
Class Collection.
Definition:
Collection.php:28
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\replace
replace(string $key, $value)
Definition:
Collection.php:87
ILIAS\GlobalScreen\ScreenContext\AdditionalData
Definition:
Collection.php:20
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\getData
getData()
Definition:
Collection.php:38
src
GlobalScreen
ScreenContext
AdditionalData
Collection.php
Generated on Thu Apr 10 2025 21:01:51 for ILIAS by
1.8.13 (using
Doxyfile
)