ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ilADTEnumDefinition Class Reference
+ Inheritance diagram for ilADTEnumDefinition:
+ Collaboration diagram for ilADTEnumDefinition:

Public Member Functions

 getType ()
 
 reset ()
 
 isNumeric ()
 
 setNumeric ($a_value)
 
 getOptions ()
 
 setOptions (array $a_values)
 
 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.ilADTEnumDefinition.php.

Member Function Documentation

◆ getADTInstance()

ilADTEnumDefinition::getADTInstance ( )

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

References isNumeric().

71  {
72  if($this->isNumeric())
73  {
74  $class = "ilADTEnumNumeric";
75  }
76  else
77  {
78  $class = "ilADTEnumText";
79  }
80  include_once "Services/ADT/classes/Types/Enum/class.ilADTEnum.php";
81  include_once "Services/ADT/classes/Types/Enum/class.".$class.".php";
82  return new $class($this);
83  }
+ Here is the call graph for this function:

◆ getOptions()

ilADTEnumDefinition::getOptions ( )

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

References $options.

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

◆ getType()

ilADTEnumDefinition::getType ( )

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

9  {
10  return "Enum";
11  }

◆ isComparableTo()

ilADTEnumDefinition::isComparableTo ( ilADT  $a_adt)

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

62  {
63  // has to be enum-based
64  return ($a_adt instanceof ilADTEnum);
65  }

◆ isNumeric()

ilADTEnumDefinition::isNumeric ( )

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

References $numeric.

Referenced by getADTInstance(), and setOptions().

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

◆ reset()

ilADTEnumDefinition::reset ( )

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

References setNumeric().

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

◆ setNumeric()

ilADTEnumDefinition::setNumeric (   $a_value)

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

Referenced by reset().

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 isNumeric().

43  {
44  if($this->isNumeric())
45  {
46  foreach(array_keys($a_values) as $key)
47  {
48  if(!is_numeric($key))
49  {
50  throw new Exception("ilADTEnum was expecting numeric option keys");
51  }
52  }
53  }
54 
55  $this->options = $a_values;
56  }
+ Here is the call graph for this function:

Field Documentation

◆ $numeric

ilADTEnumDefinition::$numeric
protected

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

Referenced by isNumeric().

◆ $options

ilADTEnumDefinition::$options
protected

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

Referenced by getOptions().


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