ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
DefInputData Class Reference
+ Inheritance diagram for DefInputData:
+ Collaboration diagram for DefInputData:

Public Member Functions

 __construct (array $values)
 
 get ($name)
 Get a named value from the data. More...
 
 getOr ($name, $value)
 Get a named value from the data and fallback to default if that name does not exist. More...
 
 get ($name)
 Get a named value from the data. More...
 
 getOr ($name, $default)
 Get a named value from the data and fallback to default if that name does not exist. More...
 

Data Fields

 $values = array()
 

Detailed Description

Definition at line 55 of file InputTest.php.

Constructor & Destructor Documentation

◆ __construct()

DefInputData::__construct ( array  $values)

Definition at line 60 of file InputTest.php.

61 {
62 $this->values = $values;
63 }

References $values.

Member Function Documentation

◆ get()

DefInputData::get (   $name)

Get a named value from the data.

Parameters
string$name
Exceptions

LogicException if name is not in data

Returns
mixed

Implements ILIAS\UI\Implementation\Component\Input\InputData.

Definition at line 66 of file InputTest.php.

67 {
68 if (!is_string($name)) {
69 throw new \InvalidArgumentException('$name is no string.');
70 }
71 if (!isset($this->values[$name])) {
72 throw new \LogicException("'$name' does not exist.");
73 }
74
75 return $this->values[$name];
76 }
if($format !==null) $name
Definition: metadata.php:230

References $name.

◆ getOr()

DefInputData::getOr (   $name,
  $default 
)

Get a named value from the data and fallback to default if that name does not exist.

Parameters
string$name
mixed$default
Returns
mixed

Implements ILIAS\UI\Implementation\Component\Input\InputData.

Definition at line 79 of file InputTest.php.

80 {
81 if (!is_string($name)) {
82 throw new \InvalidArgumentException('$name is no string.');
83 }
84 if (!isset($this->values[$name])) {
85 return $value;
86 }
87
88 return $this->values[$name];
89 }

References $name.

Field Documentation

◆ $values

DefInputData::$values = array()

Definition at line 57 of file InputTest.php.

Referenced by __construct().


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