ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilADTEnumDefinition Class Reference
+ Inheritance diagram for ilADTEnumDefinition:
+ Collaboration diagram for ilADTEnumDefinition:

Public Member Functions

 getType ()
 Get type (from class/instance) More...
 
 reset ()
 Init property defaults. More...
 
 isNumeric ()
 
 setNumeric ($a_value)
 
 getOptions ()
 
 setOptions (array $a_values)
 
 isComparableTo (ilADT $a_adt)
 Check if given ADT is comparable to self. More...
 
 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

 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 67 of file class.ilADTEnumDefinition.php.

68 {
69 if ($this->isNumeric()) {
70 $class = "ilADTEnumNumeric";
71 } else {
72 $class = "ilADTEnumText";
73 }
74 include_once "Services/ADT/classes/Types/Enum/class.ilADTEnum.php";
75 include_once "Services/ADT/classes/Types/Enum/class." . $class . ".php";
76 return new $class($this);
77 }

References isNumeric().

+ Here is the call graph for this function:

◆ getOptions()

ilADTEnumDefinition::getOptions ( )

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

References $options.

◆ getType()

ilADTEnumDefinition::getType ( )

Get type (from class/instance)

Returns
string

Reimplemented from ilADTDefinition.

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

9 {
10 return "Enum";
11 }

◆ isComparableTo()

ilADTEnumDefinition::isComparableTo ( ilADT  $a_adt)

Check if given ADT is comparable to self.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADTDefinition.

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

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

◆ isNumeric()

ilADTEnumDefinition::isNumeric ( )

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

References $numeric.

Referenced by getADTInstance(), and setOptions().

+ Here is the caller graph for this function:

◆ reset()

ilADTEnumDefinition::reset ( )

Init property defaults.

Reimplemented from ilADTDefinition.

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

17 {
18 parent::reset();
19
20 $this->options = array();
21 $this->setNumeric(true);
22 }

References setNumeric().

+ Here is the call graph for this function:

◆ setNumeric()

ilADTEnumDefinition::setNumeric (   $a_value)

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

33 {
34 $this->numeric = $a_value;
35 }

Referenced by reset().

+ Here is the caller graph for this function:

◆ setOptions()

ilADTEnumDefinition::setOptions ( array  $a_values)

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

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 }
$key
Definition: croninfo.php:18

References $key, and isNumeric().

+ 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: