ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
DefInputData Class Reference
+ Inheritance diagram for DefInputData:
+ Collaboration diagram for DefInputData:

Public Member Functions

 __construct (array $values)
 
 get (string $name)
 
 getOr (string $name, $default)
 
 has ($name)
 
- Public Member Functions inherited from ILIAS\UI\Component\Input\InputData
 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

Member Function Documentation

◆ get()

DefInputData::get ( string  $name)

Implements ILIAS\UI\Component\Input\InputData.

Definition at line 87 of file InputTest.php.

References ILIAS\UI\Implementation\Component\Input\Input\$name.

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 
)

Implements ILIAS\UI\Component\Input\InputData.

Definition at line 102 of file InputTest.php.

References ILIAS\UI\Implementation\Component\Input\Input\$name.

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.

References ILIAS\UI\Implementation\Component\Input\Input\$name.

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.


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