ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 

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  }

Member Function Documentation

◆ get()

DefInputData::get (   $name)

Get a named value from the data.

Parameters
string$name
Exceptions

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

Definition at line 66 of file InputTest.php.

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

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

◆ 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.

References ILIAS\UI\Implementation\Component\Input\Field\Input\$name, and ILIAS\UI\Implementation\Component\Input\Field\Input\$value.

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  }
if($format !==null) $name
Definition: metadata.php:230

Field Documentation

◆ $values

DefInputData::$values = array()

Definition at line 57 of file InputTest.php.


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