ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilADTEnumDefinition Class Reference
+ Inheritance diagram for ilADTEnumDefinition:
+ Collaboration diagram for ilADTEnumDefinition:

Public Member Functions

 getType ()
 
 reset ()
 
 isNumeric ()
 
 setNumeric (bool $a_value)
 
 getOptions ()
 
 setOptions (array $a_values)
 
 isComparableTo (ilADT $a_adt)
 
 getADTInstance ()
 
- Public Member Functions inherited from ilADTDefinition
 __construct ()
 
 getType ()
 Get type (from class/instance) More...
 
 reset ()
 Init property defaults. More...
 
 setAllowNull (bool $a_value)
 Toggle null allowed status. More...
 
 isNullAllowed ()
 
 isComparableTo (ilADT $a_adt)
 Check if given ADT is comparable to self. More...
 

Protected Attributes

array $options = []
 
bool $numeric
 
- Protected Attributes inherited from ilADTDefinition
bool $allow_null
 

Detailed Description

Definition at line 5 of file class.ilADTEnumDefinition.php.

Member Function Documentation

◆ getADTInstance()

ilADTEnumDefinition::getADTInstance ( )

Definition at line 63 of file class.ilADTEnumDefinition.php.

References isNumeric().

63  : ilADTEnum
64  {
65  if ($this->isNumeric()) {
66  $class = "ilADTEnumNumeric";
67  } else {
68  $class = "ilADTEnumText";
69  }
70  return new $class($this);
71  }
+ Here is the call graph for this function:

◆ getOptions()

ilADTEnumDefinition::getOptions ( )

Definition at line 37 of file class.ilADTEnumDefinition.php.

References $options.

37  : array
38  {
39  return $this->options;
40  }

◆ getType()

ilADTEnumDefinition::getType ( )

Definition at line 10 of file class.ilADTEnumDefinition.php.

10  : string
11  {
12  return "Enum";
13  }

◆ isComparableTo()

ilADTEnumDefinition::isComparableTo ( ilADT  $a_adt)

Definition at line 57 of file class.ilADTEnumDefinition.php.

57  : bool
58  {
59  // has to be enum-based
60  return ($a_adt instanceof ilADTEnum);
61  }

◆ isNumeric()

ilADTEnumDefinition::isNumeric ( )

Definition at line 27 of file class.ilADTEnumDefinition.php.

References $numeric.

Referenced by getADTInstance(), and setOptions().

27  : bool
28  {
29  return $this->numeric;
30  }
+ Here is the caller graph for this function:

◆ reset()

ilADTEnumDefinition::reset ( )

Definition at line 17 of file class.ilADTEnumDefinition.php.

References setNumeric().

17  : void
18  {
19  parent::reset();
20 
21  $this->options = array();
22  $this->setNumeric(true);
23  }
+ Here is the call graph for this function:

◆ setNumeric()

ilADTEnumDefinition::setNumeric ( bool  $a_value)

Definition at line 32 of file class.ilADTEnumDefinition.php.

Referenced by reset().

32  : void
33  {
34  $this->numeric = $a_value;
35  }
+ Here is the caller graph for this function:

◆ setOptions()

ilADTEnumDefinition::setOptions ( array  $a_values)

Definition at line 42 of file class.ilADTEnumDefinition.php.

References ILIAS\LTI\ToolProvider\$key, and isNumeric().

43  {
44  if ($this->isNumeric()) {
45  foreach (array_keys($a_values) as $key) {
46  if (!is_numeric($key)) {
47  throw new Exception("ilADTEnum was expecting numeric option keys");
48  }
49  }
50  }
51 
52  $this->options = $a_values;
53  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

Field Documentation

◆ $numeric

bool ilADTEnumDefinition::$numeric
protected

Definition at line 8 of file class.ilADTEnumDefinition.php.

Referenced by isNumeric().

◆ $options

array ilADTEnumDefinition::$options = []
protected

Definition at line 7 of file class.ilADTEnumDefinition.php.

Referenced by getOptions().


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