ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilADTMultiEnumDefinition Class Reference
+ Inheritance diagram for ilADTMultiEnumDefinition:
+ Collaboration diagram for ilADTMultiEnumDefinition:

Public Member Functions

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

Protected Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from ilADTDefinition
 reset ()
 Init property defaults. More...
 

Detailed Description

Definition at line 3 of file class.ilADTMultiEnumDefinition.php.

Member Function Documentation

◆ getADTInstance()

ilADTMultiEnumDefinition::getADTInstance ( )

Definition at line 62 of file class.ilADTMultiEnumDefinition.php.

References isNumeric().

63  {
64  if ($this->isNumeric()) {
65  $class = "ilADTMultiEnumNumeric";
66  } else {
67  $class = "ilADTMultiEnumText";
68  }
69  include_once "Services/ADT/classes/Types/MultiEnum/class.ilADTMultiEnum.php";
70  include_once "Services/ADT/classes/Types/MultiEnum/class." . $class . ".php";
71  return new $class($this);
72  }
+ Here is the call graph for this function:

◆ getOptions()

ilADTMultiEnumDefinition::getOptions ( )

Definition at line 22 of file class.ilADTMultiEnumDefinition.php.

References $options.

◆ isComparableTo()

ilADTMultiEnumDefinition::isComparableTo ( ilADT  $a_adt)

Definition at line 53 of file class.ilADTMultiEnumDefinition.php.

54  {
55  // has to be text-based
56  return ($a_adt instanceof ilADTMultiEnum);
57  }

◆ isNumeric()

ilADTMultiEnumDefinition::isNumeric ( )

Definition at line 40 of file class.ilADTMultiEnumDefinition.php.

References $numeric.

Referenced by getADTInstance(), and setOptions().

+ Here is the caller graph for this function:

◆ reset()

ilADTMultiEnumDefinition::reset ( )

Definition at line 11 of file class.ilADTMultiEnumDefinition.php.

References setNumeric().

12  {
13  parent::reset();
14 
15  $this->options = array();
16  $this->setNumeric(true);
17  }
+ Here is the call graph for this function:

◆ setNumeric()

ilADTMultiEnumDefinition::setNumeric (   $a_value)

Definition at line 45 of file class.ilADTMultiEnumDefinition.php.

Referenced by reset().

46  {
47  $this->numeric = $a_value;
48  }
+ Here is the caller graph for this function:

◆ setOptions()

ilADTMultiEnumDefinition::setOptions ( array  $a_values)

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

References $key, and isNumeric().

28  {
29  if ($this->isNumeric()) {
30  foreach (array_keys($a_values) as $key) {
31  if (!is_numeric($key)) {
32  throw new Exception("ilADTMultiEnum was expecting numeric option keys");
33  }
34  }
35  }
36 
37  $this->options = $a_values;
38  }
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

Field Documentation

◆ $numeric

ilADTMultiEnumDefinition::$numeric
protected

Definition at line 6 of file class.ilADTMultiEnumDefinition.php.

Referenced by isNumeric().

◆ $options

ilADTMultiEnumDefinition::$options = []
protected

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

Referenced by getOptions().


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