ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
◀ ilDoc Overview
EntryLockingStringMap.php
Go to the documentation of this file.
1
<?php
2
3
namespace
ILIAS\FileUpload\Collection
;
4
5
use
ILIAS\FileUpload\Collection\Exception\ElementAlreadyExistsException
;
6
use
ILIAS\FileUpload\Collection\Exception\NoSuchElementException
;
7
use
ILIAS\FileUpload\ScalarTypeCheckAware
;
8
9
/******************************************************************************
10
*
11
* This file is part of ILIAS, a powerful learning management system.
12
*
13
* ILIAS is licensed with the GPL-3.0, you should have received a copy
14
* of said license along with the source code.
15
*
16
* If this is not the case or you just want to try ILIAS, you'll find
17
* us at:
18
* https://www.ilias.de
19
* https://github.com/ILIAS-eLearning
20
*
21
*****************************************************************************/
34
final
class
EntryLockingStringMap
implements
StringMap
35
{
36
use
ScalarTypeCheckAware
;
37
private \ArrayObject
$map
;
38
39
43
public
function
__construct
()
44
{
45
$this->map = new \ArrayObject();
46
}
47
48
58
public
function
get
(
string
$key):
string
59
{
60
$this->stringTypeCheck($key,
'key'
);
61
62
if
($this->map->offsetExists($key)) {
63
return
$this->map->offsetGet($key);
64
}
65
66
throw
new
NoSuchElementException(
"No meta data associated with key \"$key\"."
);
67
}
68
69
77
public
function
toArray
(): array
78
{
79
return
$this->map->getArrayCopy();
80
}
81
82
91
public
function
has
(
string
$key): bool
92
{
93
$this->stringTypeCheck($key,
'key'
);
94
95
return
$this->map->offsetExists($key);
96
}
97
98
111
public
function
put
(
string
$key,
string
$value): void
112
{
113
$this->stringTypeCheck($key,
'key'
);
114
$this->stringTypeCheck($value,
'value'
);
115
116
if
($this->map->offsetExists($key)) {
117
throw
new
ElementAlreadyExistsException(
"Element $key can not be overwritten."
);
118
}
119
120
$this->map->offsetSet($key, $value);
121
}
122
}
ILIAS\FileUpload\Collection
Definition:
EntryLockingStringMap.php:3
ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\StringMap
Class StringMap.
Definition:
StringMap.php:30
ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMap\$map
ArrayObject $map
Definition:
EntryLockingStringMap.php:37
ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMap\has
has(string $key)
Probe if the key is known and associated with a value.
Definition:
EntryLockingStringMap.php:91
ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMap\toArray
toArray()
Returns all currently known entries.
Definition:
EntryLockingStringMap.php:77
ElementAlreadyExistsException
ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMap
Class EntryLockingStringMap.
Definition:
EntryLockingStringMap.php:34
ScalarTypeCheckAware
ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMap\__construct
__construct()
EntryLockingStringMap constructor.
Definition:
EntryLockingStringMap.php:43
ScalarTypeCheckAware
ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMap\put
put(string $key, string $value)
Puts a new key value pair into the string array.
Definition:
EntryLockingStringMap.php:111
NoSuchElementException
components
ILIAS
FileUpload
src
Collection
EntryLockingStringMap.php
Generated on Wed Sep 10 2025 15:15:38 for ILIAS by
1.8.13 (using
Doxyfile
)