ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
ArrayInputData.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\UI\Implementation\Component\Input
;
22
23
use
LogicException
;
24
use
ILIAS\UI\Component\Input\InputData
;
25
29
class
ArrayInputData
implements
InputData
30
{
31
protected
array
$data
;
32
33
public
function
__construct
(array $data)
34
{
35
$this->data =
$data
;
36
}
37
38
public
function
get
($name)
39
{
40
if
(!$this->
has
($name)) {
41
throw
new
LogicException
(
"'$name' is not contained in provided data."
);
42
}
43
44
return
$this->data[$name];
45
}
46
47
public
function
getOr
($name, $default)
48
{
49
return
$this->data[$name] ?? $default;
50
}
51
52
public
function
has
($name): bool
53
{
54
return
array_key_exists($name, $this->data);
55
}
56
}
LogicException
ILIAS\UI\Implementation\Component\Input\ArrayInputData
Definition:
ArrayInputData.php:29
ILIAS\UI\Component\Input\InputData
Describes how Input-Elements want to interact with posted data.
Definition:
InputData.php:29
ILIAS\UI\Implementation\Component\Input\ArrayInputData\has
has($name)
Definition:
ArrayInputData.php:52
InputData
ILIAS\UI\Implementation\Component\Input\ArrayInputData\$data
array $data
Definition:
ArrayInputData.php:31
ILIAS\UI\Implementation\Component\Input\ArrayInputData\getOr
getOr($name, $default)
Definition:
ArrayInputData.php:47
ILIAS\UI\Implementation\Component\Input\ArrayInputData\__construct
__construct(array $data)
Definition:
ArrayInputData.php:33
ILIAS\UI\Implementation\Component\Input
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
ArrayInputData.php:21
components
ILIAS
UI
src
Implementation
Component
Input
ArrayInputData.php
Generated on Sun Aug 31 2025 23:04:11 for ILIAS by
1.8.13 (using
Doxyfile
)