ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
DefInputData Class Reference
+ Inheritance diagram for DefInputData:
+ Collaboration diagram for DefInputData:

Public Member Functions

 __construct (array $values)
 
 get (string $name)
 @ineritdoc More...
 
 getOr (string $name, $default)
 @ineritdoc More...
 
 has ($name)
 
- Public Member Functions inherited from ILIAS\UI\Component\Input\InputData
 get (string $name)
 Get a named value from the data. More...
 
 getOr (string $name, $default)
 Get a named value from the data and fallback to default if that name does not exist. More...
 
 has (string $name)
 Check for existence of parameter name in data. More...
 

Data Fields

array $values = array()
 

Detailed Description

Definition at line 75 of file InputTest.php.

Constructor & Destructor Documentation

◆ __construct()

DefInputData::__construct ( array  $values)

Definition at line 79 of file InputTest.php.

80 {
81 $this->values = $values;
82 }
array $values
Definition: InputTest.php:77

References $values.

Member Function Documentation

◆ get()

DefInputData::get ( string  $name)

@ineritdoc

Implements ILIAS\UI\Component\Input\InputData.

Definition at line 87 of file InputTest.php.

88 {
89 if (!is_string($name)) {
90 throw new InvalidArgumentException('$name is no string.');
91 }
92 if (!isset($this->values[$name])) {
93 throw new LogicException("'$name' does not exist.");
94 }
95
96 return $this->values[$name];
97 }

◆ getOr()

DefInputData::getOr ( string  $name,
  $default 
)

@ineritdoc

Implements ILIAS\UI\Component\Input\InputData.

Definition at line 102 of file InputTest.php.

103 {
104 if (!is_string($name)) {
105 throw new InvalidArgumentException('$name is no string.');
106 }
107 if (!isset($this->values[$name])) {
108 return $default;
109 }
110
111 return $this->values[$name];
112 }

◆ has()

DefInputData::has (   $name)

Definition at line 114 of file InputTest.php.

114 : bool
115 {
116 return array_key_exists($name, $this->values);
117 }

Field Documentation

◆ $values

array DefInputData::$values = array()

Definition at line 77 of file InputTest.php.

Referenced by __construct().


The documentation for this class was generated from the following file: