ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 70 of file class.ilADTEnumDefinition.php.

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 }

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

+ 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 {
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 }

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